[vala/wip/effectfree: 24/39] codegen: Use create_temp_value in visit_object_creation_expression
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/effectfree: 24/39] codegen: Use create_temp_value in visit_object_creation_expression
- Date: Fri, 1 Jul 2011 07:51:45 +0000 (UTC)
commit a6897bc9b52d50ee1723597ebfe8955b1d5ad891
Author: Luca Bruno <lucabru src gnome org>
Date: Sat Jun 11 11:59:43 2011 +0200
codegen: Use create_temp_value in visit_object_creation_expression
codegen/valaccodebasemodule.vala | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 1d675f0..73fdd4e 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -4073,10 +4073,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
if (local != null && has_simple_struct_initializer (local)) {
instance = get_cvalue_ (get_local_cvalue (local));
} else {
- var temp_decl = get_temp_variable (expr.type_reference, false, expr);
- emit_temp_var (temp_decl);
-
- instance = get_variable_cexpression (get_variable_cname (temp_decl.name));
+ var temp_value = create_temp_value (expr.type_reference, true, expr);
+ instance = get_cvalue_ (temp_value);
}
}
@@ -4331,13 +4329,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
}
if (creation_expr != null) {
- var temp_var = get_temp_variable (expr.value_type);
- var temp_ref = get_variable_cexpression (temp_var.name);
-
- emit_temp_var (temp_var);
-
- ccode.add_assignment (temp_ref, creation_expr);
- set_cvalue (expr, temp_ref);
+ var temp_value = create_temp_value (expr.value_type, false, expr);
+ ccode.add_assignment (get_cvalue_ (temp_value), creation_expr);
+ expr.target_value = temp_value;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]