]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
it's not the IR's job to fail when a local of the same name is created twice...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 23 Aug 2012 15:22:13 +0000 (17:22 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 23 Aug 2012 15:22:13 +0000 (17:22 +0200)
ast.c
ir.c

diff --git a/ast.c b/ast.c
index be3f93b70dc20316e62e73bcf837919eefbaafbb..365803bcfa08378244e4b94722d42838e33b65fd 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -995,8 +995,11 @@ bool ast_block_codegen(ast_block *self, ast_function *func, bool lvalue, ir_valu
     /* generate locals */
     for (i = 0; i < self->locals_count; ++i)
     {
-        if (!ast_local_codegen(self->locals[i], func->ir_func, false))
+        if (!ast_local_codegen(self->locals[i], func->ir_func, false)) {
+            if (opts_debug)
+                asterror(ast_ctx(self), "failed to generate local `%s`", self->locals[i]->name);
             return false;
+        }
     }
 
     for (i = 0; i < self->exprs_count; ++i)
diff --git a/ir.c b/ir.c
index 47b9adc7798125536cf83969e61468da5068c2c8..4dc791410f415908cca89cdd21e79d6b93c3bd5b 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -138,7 +138,7 @@ static bool irwarning(lex_ctx ctx, int warntype, const char *fmt, ...)
        va_list ap;
        int lvl = LVL_WARNING;
 
-    if (!OPTS_WARN(warntype))
+    if (warntype && !OPTS_WARN(warntype))
         return false;
 
     if (opts_werror)
@@ -426,10 +426,12 @@ ir_value* ir_function_get_local(ir_function *self, const char *name)
 
 ir_value* ir_function_create_local(ir_function *self, const char *name, int vtype, bool param)
 {
-    ir_value *ve = ir_function_get_local(self, name);
-    if (ve) {
+    ir_value *ve;
+
+    /*
+    if (ir_function_get_local(self, name))
         return NULL;
-    }
+    */
 
     if (param &&
         self->locals_count &&