[PATCH] D99179: [RFC] [Coroutines] Enable printing coroutine frame in debugger if program is compiled with -g

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 10:33:33 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:894
+                                FrameDataInfo &FrameData) {
+  if (!llvm::count_if(F.getParent()->debug_compile_units(), [](auto *Iter) {
+        return dwarf::isCPlusPlus(
----------------
ChuanqiXu wrote:
> dblaikie wrote:
> > lxfind wrote:
> > > Does this mean that if there is any C++ files, we don't build debug info?
> > aside, I guess this should probably be using `llvm::none_of` - it'll shortcircuit (won't keep testing every CU if it finds one that is C++) and is more clear about the semantic goal of the test compared to the !count current phrasing.
> > 
> > But also: Why is the code searching all the CUs? Wouldn't it be better to test the CU of the Function being passed in only? Then this code won't behave differently under LTO?
> @dblaikie Thanks for reminding! Previously I am not so familiar with the API system for debug. It makes more sense to test the CU for the Function only.
> 
> This wouldn't behave differently under LTO since the related intrinsic would be lowered after we construct the coroutine frame.
> @dblaikie Thanks for reminding! Previously I am not so familiar with the API system for debug. It makes more sense to test the CU for the Function only.
> 
> This wouldn't behave differently under LTO since the related intrinsic would be lowered after we construct the coroutine frame.

I don't understand this, sorry. Do you mean that this lowering pass always happens before LTO? So the old code was only ever really (in the common use case) going to see one CU in the CU list anyway?


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

https://reviews.llvm.org/D99179



More information about the llvm-commits mailing list