[vala/wip/effectfree: 36/39] codegen: Use store_temp_value in visit_end_full_expression



commit 0756ccdc049f85d514e8fde5c77a398c2876e950
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 079b298..4e4bb42 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3044,29 +3044,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]