[vala/emitlocal: 3/8] codegen: Use create_temp_value in postfix expression
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/emitlocal: 3/8] codegen: Use create_temp_value in postfix expression
- Date: Sat, 11 Jun 2011 10:52:18 +0000 (UTC)
commit 9e99e0ad8dff54bcb58d7118c89191453b9ebc2b
Author: Luca Bruno <lucabru src gnome org>
Date: Sat Jun 11 11:10:25 2011 +0200
codegen: Use create_temp_value in postfix expression
codegen/valaccodebasemodule.vala | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 422b33a..5b56b8e 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3660,17 +3660,16 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
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);
- store_local (temp_decl, expr.inner.target_value, true);
+ var temp_value = create_temp_value (prop.property_type, false, expr);
+ store_value (temp_value, expr.inner.target_value);
// 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"));
+ var cexpr = new CCodeBinaryExpression (op, get_cvalue_ (temp_value), new CCodeConstant ("1"));
store_property (prop, ma.inner, new GLibValue (expr.value_type, cexpr));
// return previous value
- expr.target_value = get_local_cvalue (temp_decl);
+ expr.target_value = temp_value;
return;
}
@@ -3680,17 +3679,16 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
ccode.add_expression (new CCodeUnaryExpression (op, get_cvalue (expr.inner)));
} else {
// assign current value to temp variable
- var temp_decl = get_temp_variable (expr.inner.value_type, true, expr, false);
- emit_temp_var (temp_decl);
- store_local (temp_decl, expr.inner.target_value, true);
+ var temp_value = create_temp_value (expr.inner.value_type, false, expr);
+ store_value (temp_value, expr.inner.target_value);
// increment/decrement variable
var op = expr.increment ? CCodeBinaryOperator.PLUS : CCodeBinaryOperator.MINUS;
- var cexpr = new CCodeBinaryExpression (op, get_variable_cexpression (temp_decl.name), new CCodeConstant ("1"));
+ var cexpr = new CCodeBinaryExpression (op, get_cvalue_ (temp_value), new CCodeConstant ("1"));
ccode.add_assignment (get_cvalue (expr.inner), cexpr);
// return previous value
- expr.target_value = get_local_cvalue (temp_decl);
+ expr.target_value = temp_value;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]