]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.c
More cleanup
[xonotic/gmqcc.git] / ir.c
diff --git a/ir.c b/ir.c
index f4f386d260b2a93e8e0fdd01f1fb540b2479f2d3..8c3d23423ed75267574d47c4d7fafa493c93f51e 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -1,26 +1,3 @@
-/*
- * Copyright (C) 2012, 2013, 2014
- *     Wolfgang Bumiller
- *     Dale Weiler
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is furnished to do
- * so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
 #include <stdlib.h>
 #include <string.h>
 
@@ -1124,7 +1101,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 +3558,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 +3670,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;
         }