[vala/emitlocal] codegen: Use create_temp_value in transform_value
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/emitlocal] codegen: Use create_temp_value in transform_value
- Date: Tue, 14 Jun 2011 10:03:11 +0000 (UTC)
commit e32f7d4a88fb1eaee9c299a569fa4b872bbda5de
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 b9ee497..849b207 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5178,11 +5178,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
@@ -5203,10 +5201,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]