]> 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>
Mon, 2 Jun 2025 18:32:08 +0000 (19:32 +0100)
commit7037c72a8bb41ed07da64b23e14857a066a91baa
tree9563c393407655df9d662a8b7fda01475b023797
parent0ae77a05c416c9f750cb87f1bef0800651168b7e
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>
gcc/cp/coroutines.cc