]> 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>
Tue, 29 Jul 2025 15:06:17 +0000 (16:06 +0100)
commit81e04fd3d291739d4d2feb2e1b6fc62cd91742e6
treec91cf04df7bbc6c781a37fff05cb26455d62f8ea
parentf3fbacc8fd4fd9a488491394cd49fb88915db8fc
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>
(cherry picked from commit bfd4aae0a999375cf008b75c14607c7b94daced3)
gcc/cp/coroutines.cc