[vala/wip/effectfree: 39/43] codegen: Use create_temp_value in copy_value



commit 4abd68dc2b14aeaf6de417ca589d3411a7e5e795
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Jun 19 08:34:14 2011 +0200

    codegen: Use create_temp_value in copy_value

 codegen/valaccodebasemodule.vala |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index b52430b..8b8e62f 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3762,9 +3762,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 		if (type is ValueType && !type.nullable) {
 			// normal value type, no null check
 
-			var decl = get_temp_variable (type, false, node);
-			emit_temp_var (decl);
-			var ctemp = get_variable_cexpression (decl.name);
+			var temp_value = create_temp_value (type, true, node, true);
+			var ctemp = get_cvalue_ (temp_value);
 
 			var vt = (ValueType) type;
 			var st = (Struct) vt.type_symbol;
@@ -3795,15 +3794,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 				ccode.add_else ();
 
 				// g_value_init/copy must not be called for uninitialized values
-				store_local (decl, value, true);
+				store_value (temp_value, value);
 				ccode.close ();
 			} else {
 				ccode.add_expression (copy_call);
 			}
 
-			result.value_type = decl.variable_type;
-			result.cvalue = ctemp;
-			return result;
+			return temp_value;
 		}
 
 		/* (temp = expr, temp == NULL ? NULL : ref (temp))



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