have the ir take over some more context data from the ast

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-19 20:43:04 +02:00
parent f0f9680774
commit 53b9906242

2
ast.c
View file

@ -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); v = ir_builder_create_field(ir, self->name, self->expression.next->expression.vtype);
if (!v) if (!v)
return false; return false;
v->context = ast_ctx(self);
if (self->isconst) { if (self->isconst) {
asterror(ast_ctx(self), "TODO: constant field pointers with value\n"); asterror(ast_ctx(self), "TODO: constant field pointers with value\n");
goto error; 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"); asterror(ast_ctx(self), "ir_builder_create_global failed\n");
return false; return false;
} }
v->context = ast_ctx(self);
if (self->isconst) { if (self->isconst) {
switch (self->expression.vtype) switch (self->expression.vtype)