From: Wolfgang (Blub) Bumiller Date: Wed, 21 Nov 2012 19:13:31 +0000 (+0100) Subject: removed phi_out from ast_ternary since we have a place in ast_expression_common for... X-Git-Tag: 0.1.9~374 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a7fb45f102d281efe1827c700f1dcc5fc4ce3c68;p=xonotic%2Fgmqcc.git removed phi_out from ast_ternary since we have a place in ast_expression_common for this kind of value --- diff --git a/ast.c b/ast.c index 3bfb918..b1ceb1c 100644 --- 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 f0e9e6b..00802ca 100644 --- 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*);