From 1e9d02da146c276b267ca4f6c7ffb86883e9a93f Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Wed, 2 May 2012 19:21:25 +0200 Subject: [PATCH] going through function blocks in ast_function_codegen --- ast.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ast.c b/ast.c index 96e419d..5f8025c 100644 --- a/ast.c +++ b/ast.c @@ -421,11 +421,19 @@ error: /* clean up */ bool ast_function_codegen(ast_function *self, ir_builder *ir) { + ir_value *dummy; + size_t i; if (!self->ir_func) { printf("ast_function's related ast_value was not generated yet\n"); return false; } - return false; + + for (i = 0; i < self->blocks_count; ++i) { + ast_expression_codegen *gen = self->blocks[i]->expression.codegen; + if (!(*gen)((ast_expression*)self->blocks[i], self, false, &dummy)) + return false; + } + return true; } bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_value **out) -- 2.39.2