]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, coroutines: Some cleanups in build_actor.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 31 May 2025 15:13:40 +0000 (16:13 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 29 Jul 2025 15:05:56 +0000 (16:05 +0100)
commitf3fbacc8fd4fd9a488491394cd49fb88915db8fc
tree0f3d15cd7794cad4b25bdf815db1e7437a677117
parentb9b3471a9eb3f490b74b57236b4c122045dbcf56
c++, coroutines: Some cleanups in build_actor.

We were incorrectly guarding all the frame cleanups on the
basis of frame_needs_free (which is always set for the present
code-gen since we have no allocation elision).  The net result
being that the (incorrect) code was behaving as expected.

We built, but never used, a label for the frame destruction;
in practice it is never triggered independently of the promise
and argument copy destruction.

Finally there are a few instances where we had been building
expressions manually rather than using higher-level APIs.

gcc/cp/ChangeLog:

* coroutines.cc (build_actor_fn): Remove an unused
label, guard the frame deallocation correctly, use
simpler APIs to build if and return statements.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
(cherry picked from commit 7037c72a8bb41ed07da64b23e14857a066a91baa)
gcc/cp/coroutines.cc