[vala/wip/effectfree: 22/38] codegen: Drop useless temporary variable in visit_end_full_expression



commit fb9575c425f6cbaaa97487334cdc3602757be631
Author: Luca Bruno <lucabru src gnome org>
Date:   Tue Jun 14 11:17:10 2011 +0200

    codegen: Drop useless temporary variable in visit_end_full_expression

 codegen/valaccodebasemodule.vala |   19 -------------------
 1 files changed, 0 insertions(+), 19 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 60c37dd..0c64ad4 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3046,30 +3046,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 			/* nothing to do without temporary variables */
 			return;
 		}
-
-		LocalVariable full_expr_var = null;
-
-		var local_decl = expr.parent_node as LocalVariable;
-		if (!(local_decl != null && has_simple_struct_initializer (local_decl))) {
-			var expr_type = expr.value_type;
-			if (expr.target_type != null) {
-				expr_type = expr.target_type;
-			}
-
-			full_expr_var = get_temp_variable (expr_type, true, expr, false);
-			emit_temp_var (full_expr_var);
-		
-			ccode.add_assignment (get_variable_cexpression (full_expr_var.name), get_cvalue (expr));
-		}
 		
 		foreach (LocalVariable local in temp_ref_vars) {
 			ccode.add_expression (destroy_local (local));
 		}
 
-		if (full_expr_var != null) {
-			set_cvalue (expr, get_variable_cexpression (full_expr_var.name));
-		}
-
 		temp_ref_vars.clear ();
 	}
 	



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