[vala/emit-let] codegen: Don't check for comma expression in visit_addressof_expression



commit ca134be24b62fb5720fdc06195ec4a02ceb1150b
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Mar 5 11:09:24 2011 +0100

    codegen: Don't check for comma expression in visit_addressof_expression
    
    All comma expressions have been dropped, so it's not possible that
    an inner C expression is a comma expression.

 codegen/valaccodebasemodule.vala |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 5cacf96..2770cb4 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4781,15 +4781,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 	}
 
 	public override void visit_addressof_expression (AddressofExpression expr) {
-		if (get_cvalue (expr.inner) is CCodeCommaExpression) {
-			var ccomma = get_cvalue (expr.inner) as CCodeCommaExpression;
-			var inner = ccomma.get_inner ();
-			var last = inner.get (inner.size - 1);
-			ccomma.set_expression (inner.size - 1, new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, (CCodeExpression) last));
-			set_cvalue (expr, ccomma);
-		} else {
-			set_cvalue (expr, new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_cvalue (expr.inner)));
-		}
+		set_cvalue (expr, new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_cvalue (expr.inner)));
 	}
 
 	public override void visit_reference_transfer_expression (ReferenceTransferExpression expr) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]