[vala] codegen: Use store_local and get_local_cvalue in postfix expressions
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Use store_local and get_local_cvalue in postfix expressions
- Date: Tue, 3 May 2011 14:00:34 +0000 (UTC)
commit 495833ecfd737d7c3c6af74f1a91ffc984ce69f0
Author: Luca Bruno <lucabru src gnome org>
Date: Tue May 3 15:56:14 2011 +0200
codegen: Use store_local and get_local_cvalue in postfix expressions
codegen/valaccodebasemodule.vala | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 1f4c408..bc6d433 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3743,19 +3743,19 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
if (ma != null) {
// property postfix expression
var prop = (Property) ma.symbol_reference;
-
+
// assign current value to temp variable
var temp_decl = get_temp_variable (prop.property_type, true, expr, false);
emit_temp_var (temp_decl);
- ccode.add_assignment (get_variable_cexpression (temp_decl.name), get_cvalue (expr.inner));
-
+ store_local (temp_decl, expr.inner.target_value, true);
+
// increment/decrement property
var op = expr.increment ? CCodeBinaryOperator.PLUS : CCodeBinaryOperator.MINUS;
var cexpr = new CCodeBinaryExpression (op, get_variable_cexpression (temp_decl.name), new CCodeConstant ("1"));
store_property (prop, ma.inner, new GLibValue (expr.value_type, cexpr));
-
+
// return previous value
- set_cvalue (expr, get_variable_cexpression (temp_decl.name));
+ expr.target_value = get_local_cvalue (temp_decl);
return;
}
@@ -3767,7 +3767,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
// assign current value to temp variable
var temp_decl = get_temp_variable (expr.inner.value_type, true, expr, false);
emit_temp_var (temp_decl);
- ccode.add_assignment (get_variable_cexpression (temp_decl.name), get_cvalue (expr.inner));
+ store_local (temp_decl, expr.inner.target_value, true);
// increment/decrement variable
var op = expr.increment ? CCodeBinaryOperator.PLUS : CCodeBinaryOperator.MINUS;
@@ -3775,7 +3775,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
ccode.add_assignment (get_cvalue (expr.inner), cexpr);
// return previous value
- set_cvalue (expr, get_variable_cexpression (temp_decl.name));
+ expr.target_value = get_local_cvalue (temp_decl);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]