Generating fields using ir_builder_create_field

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-11 18:05:56 +02:00
parent 5f2a775d41
commit 91e3765a00

12
ast.c
View file

@ -616,6 +616,18 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir)
return true;
}
if (self->expression.vtype == TYPE_FIELD) {
v = ir_builder_create_field(ir, self->name, self->expression.next->expression.vtype);
if (!v)
return false;
if (self->isconst) {
printf("TODO: constant field pointers with value\n");
goto error;
}
self->ir_v = v;
return true;
}
v = ir_builder_create_global(ir, self->name, self->expression.vtype);
if (!v)
return false;