[vala/wip/effectfree: 41/43] codegen: Use store_temp_value in visit_end_full_expression



commit 32a19c16e64b46ff1c4468069fc02dd62447487c
Author: Luca Bruno <lucabru src gnome org>
Date:   Fri Jul 1 09:45:55 2011 +0200

    codegen: Use store_temp_value in visit_end_full_expression

 codegen/valaccodebasemodule.vala |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 86146e1..98f7967 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3047,29 +3047,15 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 			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));
+			expr.target_value = store_temp_value (expr.target_value, expr);
 		}
-		
+
 		foreach (var value in temp_ref_values) {
 			ccode.add_expression (destroy_value (value));
 		}
 
-		if (full_expr_var != null) {
-			set_cvalue (expr, get_variable_cexpression (full_expr_var.name));
-		}
-
 		temp_ref_values.clear ();
 	}
 	



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