]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, coroutines: Rework the ramp codegen.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 27 Aug 2024 15:38:10 +0000 (16:38 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 20 Sep 2024 13:43:32 +0000 (14:43 +0100)
commitcbe1b1c6c7408b20aa899c5e9c607c706cee8ca0
tree215b920c5378f981294ef9a9c3f935af1a794e26
parent664e0ce580a8f20a78aa355c42222e4647841f77
c++, coroutines: Rework the ramp codegen.

Now that we have separated the codegen of the ramp, actor and
destroy functions, we no longer need to manage the scopes for
variables manually.

This introduces a helper function that allows us to build a
local var with a DECL_VALUE_EXPR that relates to the coroutine
state frame entry.

This fixes a latent issue where we would generate guard vars
when exceptions were disabled.

gcc/cp/ChangeLog:

* coroutines.cc (coro_build_artificial_var_with_dve): New.
(coro_build_and_push_artificial_var): New.
(coro_build_and_push_artificial_var_with_dve): New.
(analyze_fn_parms): Ensure that frame entries cannot clash
with local variables.
(build_coroutine_frame_delete_expr): Amend comment.
(cp_coroutine_transform::build_ramp_function): Rework to
avoid manual management of variables and scopes.

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