mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
Generating fields using ir_builder_create_field
This commit is contained in:
parent
5f2a775d41
commit
91e3765a00
1 changed files with 12 additions and 0 deletions
12
ast.c
12
ast.c
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue