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

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 17:48:47 PST 2021


aprantl added a comment.

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.


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

https://reviews.llvm.org/D93497



More information about the llvm-commits mailing list