From 2d2c31cc18aa9af2cdf26fa462edf7a164d45328 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 12 Mar 2019 22:18:43 +0100 Subject: Refactor ssa --- src/ssa/ssa.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/ssa') 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 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); + } +} -- cgit v1.2.3