]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
removed phi_out from ast_ternary since we have a place in ast_expression_common for...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 21 Nov 2012 19:13:31 +0000 (20:13 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 21 Nov 2012 19:13:31 +0000 (20:13 +0100)
ast.c
ast.h

diff --git a/ast.c b/ast.c
index 3bfb9182754c03cc3cae59fb7cda4900649bcaaf..b1ceb1c6b990414800bf6d0619af358e17b01b3f 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -651,7 +651,6 @@ ast_ternary* ast_ternary_new(lex_ctx ctx, ast_expression *cond, ast_expression *
     self->cond     = cond;
     self->on_true  = ontrue;
     self->on_false = onfalse;
-    self->phi_out  = NULL;
 
     return self;
 }
@@ -2012,8 +2011,8 @@ bool ast_ternary_codegen(ast_ternary *self, ast_function *func, bool lvalue, ir_
      * may still happen, thus we remember a created ir_value and simply return one
      * if it already exists.
      */
-    if (self->phi_out) {
-        *out = self->phi_out;
+    if (self->expression.outr) {
+        *out = self->expression.outr;
         return true;
     }
 
@@ -2087,8 +2086,8 @@ bool ast_ternary_codegen(ast_ternary *self, ast_function *func, bool lvalue, ir_
     ir_phi_add(phi, ontrue,  trueval);
     ir_phi_add(phi, onfalse, falseval);
 
-    self->phi_out = ir_phi_value(phi);
-    *out = self->phi_out;
+    self->expression.outr = ir_phi_value(phi);
+    *out = self->expression.outr;
 
     return true;
 }
diff --git a/ast.h b/ast.h
index f0e9e6b0e480d4f1f1afcd5f48c5e0ecc1213c7a..00802ca3168aca62fbab474dc20111b78a3465b0 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -398,9 +398,6 @@ struct ast_ternary_s
     /* It's all just 'expressions', since an ast_block is one too. */
     ast_expression *on_true;
     ast_expression *on_false;
-    /* After a ternary expression we find ourselves in a new IR block
-     * and start with a PHI node */
-    ir_value       *phi_out;
 };
 ast_ternary* ast_ternary_new(lex_ctx ctx, ast_expression *cond, ast_expression *ontrue, ast_expression *onfalse);
 void ast_ternary_delete(ast_ternary*);