[vala/emitlocal: 14/15] codegen: Use create_temp_value in transform_value
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/emitlocal: 14/15] codegen: Use create_temp_value in transform_value
- Date: Tue, 14 Jun 2011 10:07:00 +0000 (UTC)
commit bcbd656aa2511088f21c25d5b220a027ee3b2df6
Author: Luca Bruno <lucabru src gnome org>
Date: Tue Jun 14 11:55:44 2011 +0200
codegen: Use create_temp_value in transform_value
codegen/valaccodebasemodule.vala | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index dd5430b..de606a6 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5176,11 +5176,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
} else if (result.cvalue is CCodeIdentifier || result.cvalue is CCodeMemberAccess) {
result.cvalue = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, result.cvalue);
} else {
- var decl = get_temp_variable (type, type.value_owned, type, false);
- emit_temp_var (decl);
-
- ccode.add_assignment (get_variable_cexpression (decl.name), result.cvalue);
- result.cvalue = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (decl.name));
+ var temp_value = create_temp_value (type, false, node);
+ store_value (temp_value, result);
+ result.cvalue = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_cvalue_ (temp_value));
}
} else if (unboxing) {
// unbox value
@@ -5201,10 +5199,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
result = copy;
// drop this assignment when target values are guaranteed to be effect-free
if (!(target_type is ArrayType && ((ArrayType) target_type).fixed_length)) {
- var decl = get_temp_variable (target_type, true, node, false);
- emit_temp_var (decl);
- ccode.add_assignment (get_variable_cexpression (decl.name), get_cvalue_ (result));
- result.cvalue = get_variable_cexpression (decl.name);
+ var temp_value = create_temp_value (target_type, false, node);
+ store_value (temp_value, result);
+ result.cvalue = get_cvalue_ (temp_value);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]