X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ast.c;h=995ba094efa04432e655135b489e7e61fb3b7148;hp=2b4a456ebb08e5e388d79bbe9a910d49c51d1a9e;hb=6df3c625b0f8501b2ed2ecc61e29d104f28f84b8;hpb=5ea710e317f01bccc754b66454d6c2ae07fa2e76 diff --git a/ast.c b/ast.c index 2b4a456..995ba09 100644 --- a/ast.c +++ b/ast.c @@ -1164,6 +1164,8 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield) self->constval.vfunc->ir_func = func; self->ir_v = func->value; + if (self->expression.flags & AST_FLAG_INCLUDE_DEF) + self->ir_v->flags |= IR_FLAG_INCLUDE_DEF; /* The function is filled later on ast_function_codegen... */ return true; } @@ -1206,6 +1208,8 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield) v->unique_life = true; v->locked = true; array->ir_v = self->ir_v = v; + if (self->expression.flags & AST_FLAG_INCLUDE_DEF) + self->ir_v->flags |= IR_FLAG_INCLUDE_DEF; namelen = strlen(self->name); name = (char*)mem_a(namelen + 16); @@ -1224,6 +1228,8 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield) array->ir_values[ai]->context = ast_ctx(self); array->ir_values[ai]->unique_life = true; array->ir_values[ai]->locked = true; + if (self->expression.flags & AST_FLAG_INCLUDE_DEF) + self->ir_values[ai]->flags |= IR_FLAG_INCLUDE_DEF; } mem_d(name); } @@ -1234,6 +1240,8 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield) return false; v->context = ast_ctx(self); self->ir_v = v; + if (self->expression.flags & AST_FLAG_INCLUDE_DEF) + self->ir_v->flags |= IR_FLAG_INCLUDE_DEF; } return true; } @@ -1258,6 +1266,8 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield) v->context = ast_ctx(self); v->unique_life = true; v->locked = true; + if (self->expression.flags & AST_FLAG_INCLUDE_DEF) + v->flags |= IR_FLAG_INCLUDE_DEF; namelen = strlen(self->name); name = (char*)mem_a(namelen + 16); @@ -1276,6 +1286,8 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield) self->ir_values[ai]->context = ast_ctx(self); self->ir_values[ai]->unique_life = true; self->ir_values[ai]->locked = true; + if (self->expression.flags & AST_FLAG_INCLUDE_DEF) + self->ir_values[ai]->flags |= IR_FLAG_INCLUDE_DEF; } mem_d(name); } @@ -1338,6 +1350,8 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir, bool isfield) /* link us to the ir_value */ v->cvq = self->cvq; self->ir_v = v; + if (self->expression.flags & AST_FLAG_INCLUDE_DEF) + self->ir_v->flags |= IR_FLAG_INCLUDE_DEF; return true; error: /* clean up */