[PATCH] D94388: [Coroutine][DebugInfo] Enhance the ability of coroutine to debug parameters under O2

Yifeng Dong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 22:55:55 PST 2021


dongAxis1944 added a comment.

I think if we use fake variable to solve this, it might cause the patch https://reviews.llvm.org/D93497 fail to print variable under O0 level

In D94388#2499901 <https://reviews.llvm.org/D94388#2499901>, @junparser wrote:

> In D94388#2499897 <https://reviews.llvm.org/D94388#2499897>, @junparser wrote:
>
>> In D94388#2494294 <https://reviews.llvm.org/D94388#2494294>, @aprantl wrote:
>>
>>> Do we understand *why* the frontend is emitting the variables twice? If that just a bug in the clang frontend (which would be my first guess) then we should aim at fixing the frontend instead. If the frontend is trying to do something different, I would love to understand what that is.
>>
>> Hi @aprantl, 
>> According to the standard, coroutine needs to copy parameters (calling constructor) passed to the coroutine function by the original caller into the coroutine frame. So in frontend, we fake local variables for this behavior, that why we see two variables in debuginfo.
>
> So, this is not the bug, shold we avoid this by using anonymous fake variables?




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

https://reviews.llvm.org/D94388



More information about the llvm-commits mailing list