X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ir.c;h=5a6229fc9f87d0259054a3fd839e3a9d4ed914ac;hp=f4f386d260b2a93e8e0fdd01f1fb540b2479f2d3;hb=783b7b6594cb3fde2b9bf945df7a68cb3afa2d5f;hpb=3df51c597935aa4b60da7a27883779ff584209e3 diff --git a/ir.c b/ir.c index f4f386d..5a6229f 100644 --- a/ir.c +++ b/ir.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013, 2014 + * Copyright (C) 2012, 2013, 2014, 2015 * Wolfgang Bumiller * Dale Weiler * @@ -1124,7 +1124,9 @@ ir_value* ir_value_var(const char *name, int storetype, int vtype) /* helper function */ static ir_value* ir_builder_imm_float(ir_builder *self, float value, bool add_to_list) { ir_value *v = ir_value_var("#IMMEDIATE", store_global, TYPE_FLOAT); + v->flags |= IR_FLAG_ERASABLE; v->hasvalue = true; + v->cvq = CV_CONST; v->constval.vfloat = value; vec_push(self->globals, v); @@ -3579,7 +3581,7 @@ static bool gen_global_function_code(ir_builder *ir, ir_value *global) * If there is no definition and the thing is eraseable, we can ignore * outputting the function to begin with. */ - if (global->flags & IR_FLAG_ERASEABLE && irfun->code_function_def < 0) { + if (global->flags & IR_FLAG_ERASABLE && irfun->code_function_def < 0) { return true; } @@ -3691,7 +3693,7 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc * if we're eraseable and the function isn't referenced ignore outputting * the function. */ - if (global->flags & IR_FLAG_ERASEABLE && vec_size(global->reads) == 0) { + if (global->flags & IR_FLAG_ERASABLE && vec_size(global->reads) == 0) { return true; }