[vala/emitlocal: 5/8] codegen: Use create_temp_value in visit_object_creation_expression



commit a7c71c3281684affebb0f15ee9f9e556858bfdb8
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 a132b9e..6dc12d0 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4103,10 +4103,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);
 			}
 		}
 
@@ -4361,13 +4359,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]