[vala] GAsync: Various fixes for temp variables in coroutines
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] GAsync: Various fixes for temp variables in coroutines
- Date: Wed, 16 Sep 2009 13:46:39 +0000 (UTC)
commit a7684fadacd7325537b1146500569cb10b669854
Author: Jürg Billeter <j bitron ch>
Date: Wed Sep 16 15:46:06 2009 +0200
GAsync: Various fixes for temp variables in coroutines
codegen/valaccodearraymodule.vala | 6 +++---
codegen/valaccodebasemodule.vala | 4 ++--
codegen/valaccodecontrolflowmodule.vala | 4 ++--
codegen/valaccodememberaccessmodule.vala | 10 +++++-----
codegen/valaccodemethodcallmodule.vala | 2 +-
codegen/valagsignalmodule.vala | 8 ++++----
6 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala
index e207168..c2c5d7b 100644
--- a/codegen/valaccodearraymodule.vala
+++ b/codegen/valaccodearraymodule.vala
@@ -52,7 +52,7 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
var ce = new CCodeCommaExpression ();
var temp_var = get_temp_variable (array_type, true, expr);
- var name_cnode = new CCodeIdentifier (temp_var.name);
+ var name_cnode = get_variable_cexpression (temp_var.name);
int i = 0;
temp_vars.insert (0, temp_var);
@@ -77,7 +77,7 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
if (!is_pure_ccode_expression (csize)) {
var temp_var = get_temp_variable (int_type, false, expr);
- var name_cnode = new CCodeIdentifier (temp_var.name);
+ var name_cnode = get_variable_cexpression (temp_var.name);
size.ccodenode = name_cnode;
temp_vars.insert (0, temp_var);
@@ -103,7 +103,7 @@ internal class Vala.CCodeArrayModule : CCodeMethodCallModule {
if (expr.initializer_list != null) {
var ce = new CCodeCommaExpression ();
var temp_var = get_temp_variable (expr.value_type, true, expr);
- var name_cnode = new CCodeIdentifier (temp_var.name);
+ var name_cnode = get_variable_cexpression (temp_var.name);
int i = 0;
temp_vars.insert (0, temp_var);
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index aeade77..aed8f7f 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -2970,7 +2970,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
ccomma.append_expression (ccall);
// return previous value
- ccomma.append_expression (new CCodeIdentifier (temp_decl.name));
+ ccomma.append_expression (get_variable_cexpression (temp_decl.name));
expr.ccodenode = ccomma;
return;
@@ -3595,7 +3595,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
var temp_var = get_temp_variable (param.parameter_type);
temp_vars.insert (0, temp_var);
ccomma.append_expression (new CCodeAssignment (get_variable_cexpression (temp_var.name), cexpr));
- ccomma.append_expression (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (temp_var.name)));
+ ccomma.append_expression (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (temp_var.name)));
return ccomma;
}
diff --git a/codegen/valaccodecontrolflowmodule.vala b/codegen/valaccodecontrolflowmodule.vala
index cb1b8c2..0a7d274 100644
--- a/codegen/valaccodecontrolflowmodule.vala
+++ b/codegen/valaccodecontrolflowmodule.vala
@@ -47,7 +47,7 @@ internal class Vala.CCodeControlFlowModule : CCodeMethodModule {
var temp_var = get_temp_variable (stmt.expression.value_type, stmt.expression.value_type.value_owned, stmt);
stmt.expression.temp_vars.insert (0, temp_var);
- var ctemp = new CCodeIdentifier (temp_var.name);
+ var ctemp = get_variable_cexpression (temp_var.name);
var cinit = new CCodeAssignment (ctemp, (CCodeExpression) stmt.expression.ccodenode);
var czero = new CCodeConstant ("0");
@@ -90,7 +90,7 @@ internal class Vala.CCodeControlFlowModule : CCodeMethodModule {
cswitchblock.append (new CCodeExpressionStatement (cinit));
- ctemp = new CCodeIdentifier (temp_var.name);
+ ctemp = get_variable_cexpression (temp_var.name);
cinit = new CCodeAssignment (ctemp, ccond);
cswitchblock.append (new CCodeExpressionStatement (cinit));
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 85424fc..6c7dc86 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -83,7 +83,7 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
// store in temp. variable
var temp_var = get_temp_variable (expr.inner.value_type);
temp_vars.insert (0, temp_var);
- var ctemp = new CCodeIdentifier (temp_var.name);
+ var ctemp = get_variable_cexpression (temp_var.name);
inst = new CCodeAssignment (ctemp, pub_inst);
expr.inner.ccodenode = ctemp;
}
@@ -274,7 +274,7 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
if (base_property.property_type.is_real_struct_type ()) {
var ccomma = new CCodeCommaExpression ();
var temp_var = get_temp_variable (base_property.get_accessor.value_type);
- var ctemp = new CCodeIdentifier (temp_var.name);
+ var ctemp = get_variable_cexpression (temp_var.name);
temp_vars.add (temp_var);
ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, ctemp));
ccomma.append_expression (ccall);
@@ -285,7 +285,7 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
if (array_type != null && !base_property.no_array_length) {
for (int dim = 1; dim <= array_type.rank; dim++) {
var temp_var = get_temp_variable (int_type);
- var ctemp = new CCodeIdentifier (temp_var.name);
+ var ctemp = get_variable_cexpression (temp_var.name);
temp_vars.add (temp_var);
ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, ctemp));
expr.append_array_size (ctemp);
@@ -294,7 +294,7 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
var delegate_type = base_property.property_type as DelegateType;
if (delegate_type != null && delegate_type.delegate_symbol.has_target) {
var temp_var = get_temp_variable (new PointerType (new VoidType ()));
- var ctemp = new CCodeIdentifier (temp_var.name);
+ var ctemp = get_variable_cexpression (temp_var.name);
temp_vars.add (temp_var);
ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, ctemp));
expr.delegate_target = ctemp;
@@ -325,7 +325,7 @@ internal class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
var ccomma = new CCodeCommaExpression ();
var temp_var = get_temp_variable (expr.value_type);
- var ctemp = new CCodeIdentifier (temp_var.name);
+ var ctemp = get_variable_cexpression (temp_var.name);
temp_vars.add (temp_var);
ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, ctemp));
ccall.add_argument (new CCodeConstant ("NULL"));
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index efff5c1..f11b279 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -350,7 +350,7 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
temp_vars.insert (0, temp_decl);
ccomma.append_expression (new CCodeAssignment (get_variable_cexpression (temp_decl.name), cexpr));
- cexpr = new CCodeIdentifier (temp_decl.name);
+ cexpr = get_variable_cexpression (temp_decl.name);
ccomma.append_expression (ccall_expr);
diff --git a/codegen/valagsignalmodule.vala b/codegen/valagsignalmodule.vala
index fecfba6..34d23ee 100644
--- a/codegen/valagsignalmodule.vala
+++ b/codegen/valagsignalmodule.vala
@@ -533,7 +533,7 @@ internal class Vala.GSignalModule : GObjectModule {
parse_call.add_argument (sig.get_canonical_cconstant (signal_detail));
var decl_type = (TypeSymbol) sig.parent_symbol;
parse_call.add_argument (new CCodeIdentifier (decl_type.get_type_id ()));
- parse_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (temp_decl.name)));
+ parse_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (temp_decl.name)));
if (signal_detail == null) {
parse_call.add_argument (new CCodeConstant ("NULL"));
} else {
@@ -543,7 +543,7 @@ internal class Vala.GSignalModule : GObjectModule {
}
parse_call.add_argument (new CCodeConstant ("FALSE"));
ccomma.append_expression (parse_call);
- ccomma.append_expression (new CCodeIdentifier (temp_decl.name));
+ ccomma.append_expression (get_variable_cexpression (temp_decl.name));
// third argument: signal_id
ccall.add_argument (ccomma);
@@ -740,7 +740,7 @@ internal class Vala.GSignalModule : GObjectModule {
parse_call.add_argument (sig.get_canonical_cconstant (signal_detail));
var decl_type = (TypeSymbol) sig.parent_symbol;
parse_call.add_argument (new CCodeIdentifier (decl_type.get_type_id ()));
- parse_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (temp_decl.name)));
+ parse_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression (temp_decl.name)));
if (signal_detail == null) {
parse_call.add_argument (new CCodeConstant ("NULL"));
} else {
@@ -750,7 +750,7 @@ internal class Vala.GSignalModule : GObjectModule {
}
parse_call.add_argument (new CCodeConstant ("FALSE"));
ccomma.append_expression (parse_call);
- ccomma.append_expression (new CCodeIdentifier (temp_decl.name));
+ ccomma.append_expression (get_variable_cexpression (temp_decl.name));
// third argument: signal_id
ccall.add_argument (ccomma);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]