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



commit e2740707a469e4036c00962fc016de613de4065f
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 5211fb2..0522c03 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4778,15 +4778,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]