[vala/wip/effectfree: 25/38] codegen: Use create_temp_value in visit_object_creation_expression



commit 4e787a30263f8a250b061732cbc6274f3e1af6db
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Jun 11 11:59:43 2011 +0200

    codegen: Use create_temp_value in visit_object_creation_expression

 codegen/valaccodebasemodule.vala |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 955ab8c..67203c0 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4054,10 +4054,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 			if (local != null && has_simple_struct_initializer (local)) {
 				instance = get_cvalue_ (get_local_cvalue (local));
 			} else {
-				var temp_decl = get_temp_variable (expr.type_reference, false, expr);
-				emit_temp_var (temp_decl);
-
-				instance = get_variable_cexpression (get_variable_cname (temp_decl.name));
+				var temp_value = create_temp_value (expr.type_reference, true, expr);
+				instance = get_cvalue_ (temp_value);
 			}
 		}
 
@@ -4312,13 +4310,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 		}
 
 		if (creation_expr != null) {
-			var temp_var = get_temp_variable (expr.value_type);
-			var temp_ref = get_variable_cexpression (temp_var.name);
-
-			emit_temp_var (temp_var);
-
-			ccode.add_assignment (temp_ref, creation_expr);
-			set_cvalue (expr, temp_ref);
+			var temp_value = create_temp_value (expr.value_type, false, expr);
+			ccode.add_assignment (get_cvalue_ (temp_value), creation_expr);
+			expr.target_value = temp_value;
 		}
 	}
 



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