coroutines: Make proxy vars for the function arg copies.
commit70ee703c479081ac2ea67eb67041551216e66783
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 10 Jul 2021 09:50:23 +0000 (10 10:50 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 14 Sep 2021 15:56:10 +0000 (14 16:56 +0100)
tree0514a9c1ec9c59b44d031d27199b213e4287153a
parentc5a735fa9df7eca4666c8da5e51ed9c5ab7cc81a
coroutines: Make proxy vars for the function arg copies.

This adds top level proxy variables for the coroutine frame
copies of the original function args.  These are then available
in the debugger to refer to the frame copies.  We rewrite the
function body to use the copies, since the original parms will
no longer be in scope when the coroutine is running.

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

* coroutines.cc (struct param_info): Add copy_var.
(build_actor_fn): Use simplified param references.
(register_param_uses): Likewise.
(rewrite_param_uses): Likewise.
(analyze_fn_parms): New function.
(coro_rewrite_function_body): Add proxies for the fn
parameters to the outer bind scope of the rewritten code.
(morph_fn_to_coro): Use simplified version of param ref.
gcc/cp/coroutines.cc