[vala/wip/effectfree: 39/44] codegen: Use create_temp_value in copy_value
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/effectfree: 39/44] codegen: Use create_temp_value in copy_value
- Date: Wed, 6 Jul 2011 21:14:20 +0000 (UTC)
commit 7947aab1726b690bfdb903d1b2d72bcbbe71538b
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 e0d9c46..02daf58 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]