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



commit 30122324c7223c66dde9995f85c86b14ede7049e
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 5e5de78..3317edb 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3733,9 +3733,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;
@@ -3766,15 +3765,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]