coroutines: Factor code. Match original source location in helpers [NFC].
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 7 Jul 2021 18:56:20 +0000 (19:56 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 9 Jul 2021 18:14:11 +0000 (19:14 +0100)
commitd5b1bb0d197f9141a0f0e510f8d1b598c3df9552
tree22b02a9c6fa868894952050897b2d432ef99f625
parent59045273cc648e354ba72f9188f69927f00802e2
coroutines: Factor code. Match original source location in helpers [NFC].

This is primarily a source code refactoring, the only change is to
ensure that the outlined functions are marked to begin at the same
line as the original.  Otherwise, they get the default (which seems
to be input_location, which corresponds to the closing brace at the
point that this is done).  Having the source location point to that
confuses some debuggers.

This is a contributory fix to:
PR c++/99215 - coroutines: debugging with gdb

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

* coroutines.cc (build_actor_fn): Move common code to
act_des_fn.
(build_destroy_fn): Likewise.
(act_des_fn): Build the void return here.  Ensure that the
source location matches the original function.
gcc/cp/coroutines.cc