[PATCH] D93497: Salvage debug info for function arguments in coro-split funclets.

JunMa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 00:19:17 PST 2021


junparser added a comment.

In D93497#2514162 <https://reviews.llvm.org/D93497#2514162>, @aprantl wrote:

> I looked into the duplicate variables. For your first testcase, there is first the function parameter `t`:
>
>   ParmVarDecl 0x1585a3de8 </Users/adrian/Downloads/test/coro-debug-2.cpp:30:10, col:24> col:24 used t 'struct test &'
>
> followed by an implicit VarDecl (thus the DW_AT_artificial attribute) for another `t`:
>
>   VarDecl 0x1585a8c30 </Users/adrian/Downloads/test/coro-debug-2.cpp:30:6> col:6 implicit used __coro_gro 'coro' nrvo cinit
>   `-CXXMemberCallExpr 0x1585a8b88 <col:6> 'coro'
>     `-MemberExpr 0x1585a8b58 <col:6> '<bound member function type>' .get_return_object 0x1585a0990
>       `-DeclRefExpr 0x1585a8b38 <col:6> 'std::experimental::__coroutine_traits_sfinae<coro>::promise_type':'coro::promise_type' lvalue Var 0x1585a57a8 '__promise' 'std::experimental::__coroutine_traits_sfinae<coro>::promise_type':'coro::promise_type'
>
> The second one is produced by `void EmitGroAlloca()` in `CGCoroutine.cpp`. I'm assuming that this is the declaration of the function parameter as it is being captured for the CoroFrame function argument that is being passed to the various `.resume` functions.

Yes, that's right.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93497/new/

https://reviews.llvm.org/D93497



More information about the llvm-commits mailing list