]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
going through function blocks in ast_function_codegen
authorWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 2 May 2012 17:21:25 +0000 (19:21 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 2 May 2012 17:21:25 +0000 (19:21 +0200)
ast.c

diff --git a/ast.c b/ast.c
index 96e419de94cf12f6edad11e23190eb34d05dec7a..5f8025cebeaba6d6211d2f7300b4165177310133 100644 (file)
--- 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)