diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-03-12 22:18:43 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | 2d2c31cc18aa9af2cdf26fa462edf7a164d45328 (patch) | |
tree | 687402ac43f28260a3ac7b9934522ae891b09557 /src/ssa | |
parent | 385e2b95cb635976aded7368c6f7ac29585b38e7 (diff) |
Refactor ssa
Diffstat (limited to 'src/ssa')
-rw-r--r-- | src/ssa/ssa.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ssa/ssa.c b/src/ssa/ssa.c index 3433e8d..f5187af 100644 --- a/src/ssa/ssa.c +++ b/src/ssa/ssa.c @@ -1,6 +1,7 @@ #include "../../include/ssa/ssa.h" #include "../../include/std/mem.h" #include "../../include/std/log.h" +#include "../../include/ast.h" #include <assert.h> static int compare_number(const void *a, const void *b) { @@ -163,3 +164,19 @@ int ssa_ins_call(Ssa *self, SsaFuncIndex func, SsaRegister *result) { amal_log_debug("r%u = CALL f%u", *result, func); return 0; } + +static void ast_generate_ssa(Ast *self, SsaCompilerContext *context) { + /* TODO: Implement */ + (void)self; + (void)context; +} + +void scope_generate_ssa(Scope *self, SsaCompilerContext *context) { + Ast *ast; + Ast *ast_end; + ast = buffer_start(&self->ast_objects); + ast_end = buffer_end(&self->ast_objects); + for(; ast != ast_end; ++ast) { + ast_generate_ssa(ast, context); + } +} |