aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/coroutines.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/coroutines.cc')
-rw-r--r--gcc/cp/coroutines.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index b1e555c..5815a8c 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -2865,8 +2865,8 @@ find_any_await (tree *stmt, int *dosub, void *d)
if (TREE_CODE (*stmt) == CO_AWAIT_EXPR)
{
*dosub = 0; /* We don't need to consider this any further. */
- tree **p = (tree **) d;
- *p = stmt;
+ if (d)
+ *(tree **)d = stmt;
return *stmt;
}
return NULL_TREE;
@@ -3116,7 +3116,9 @@ flatten_await_stmt (var_nest_node *n, hash_set<tree> *promoted,
bool already_present = promoted->add (var);
gcc_checking_assert (!already_present);
tree inner = TARGET_EXPR_INITIAL (init);
- gcc_checking_assert (TREE_CODE (inner) != COND_EXPR);
+ gcc_checking_assert
+ (TREE_CODE (inner) != COND_EXPR
+ || !cp_walk_tree (&inner, find_any_await, nullptr, nullptr));
init = cp_build_modify_expr (input_location, var, INIT_EXPR, init,
tf_warning_or_error);
/* Simplify for the case that we have an init containing the temp
@@ -4089,17 +4091,7 @@ analyze_fn_parms (tree orig, hash_map<tree, param_info> *param_uses)
}
parm.field_id = name;
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (parm.frame_type))
- {
- char *buf = xasprintf ("_Coro_q%u_%s_live", parm_num,
- DECL_NAME (arg) ? IDENTIFIER_POINTER (name)
- : "__unnamed");
- parm.guard_var
- = coro_build_artificial_var (UNKNOWN_LOCATION, get_identifier (buf),
- boolean_type_node, orig,
- boolean_false_node);
- free (buf);
- parm.trivial_dtor = false;
- }
+ parm.trivial_dtor = false;
else
parm.trivial_dtor = true;
}