Commit a7684fad authored by Jürg Billeter's avatar Jürg Billeter

GAsync: Various fixes for temp variables in coroutines

parent 8be4aec5
......@@ -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);
......
......@@ -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;
}
......
......@@ -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));
......
......@@ -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"));
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment