[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
Tue Feb 2 05:06:10 PST 2021


dongAxis1944 added a comment.

Maybe we can make the two "variables" use only one dwarf var.
It might solve this problem, I think. Do you have any ideas?

In D94388#2535388 <https://reviews.llvm.org/D94388#2535388>, @aprantl wrote:

> In D94388#2500214 <https://reviews.llvm.org/D94388#2500214>, @dongAxis1944 wrote:
>
>> 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?
>
> If I understand correctly, what ends up as the "real" function parameters in DWARF are the function arguments passed into the coro entry point, and the artificial variables are what is stored in the CoroFrame, and those are the only ones visible in the .resume funclets. Is this correct? If yes, we probably do want both to be visible, because they end up in different funclets.




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

https://reviews.llvm.org/D94388



More information about the llvm-commits mailing list