]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
have the ir take over some more context data from the ast
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 18:43:04 +0000 (20:43 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 18:43:04 +0000 (20:43 +0200)
ast.c

diff --git a/ast.c b/ast.c
index 67306a13cec6e935fbe030ff51a5247165a9eff3..f2d055dcd7f4aa16e0e44d528f916b413d9b54bd 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -788,6 +788,7 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir)
         v = ir_builder_create_field(ir, self->name, self->expression.next->expression.vtype);
         if (!v)
             return false;
+        v->context = ast_ctx(self);
         if (self->isconst) {
             asterror(ast_ctx(self), "TODO: constant field pointers with value\n");
             goto error;
@@ -801,6 +802,7 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir)
         asterror(ast_ctx(self), "ir_builder_create_global failed\n");
         return false;
     }
+    v->context = ast_ctx(self);
 
     if (self->isconst) {
         switch (self->expression.vtype)