]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, coroutines: Simplify initial_await_resume_called.
authorIain Sandoe <iain@sandoe.co.uk>
Thu, 29 May 2025 12:43:37 +0000 (13:43 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 5 Jun 2025 06:55:33 +0000 (07:55 +0100)
commitbfd4aae0a999375cf008b75c14607c7b94daced3
tree4ffa3a7af8d80c9d3827e12ac177931d1c2906fe
parent24cbcc49277a0ac40fc2d82831f6db5e8d6d890d
c++, coroutines: Simplify initial_await_resume_called.

We do not need to generate this code early, since it does not affect
any of the analysis.  Lowering it later takes less code, and avoids
modifying the initial await expresssion which will simplify changes
to analysis to deal with open PRs.

gcc/cp/ChangeLog:

* coroutines.cc (expand_one_await_expression): Set the
initial_await_resume_called flag here.
(build_actor_fn): Populate the frame accessor for the
initial_await_resume_called flag.
(cp_coroutine_transform::wrap_original_function_body): Do
not modify the initial_await expression to include the
initial_await_resume_called flag here.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/coroutines.cc