[PATCH] D75338: [Coroutines] Use dbg.declare for frame variables

Brian Gesiak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 12:37:15 PST 2020


modocache added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:747
+      TinyPtrVector<DbgVariableIntrinsic *> DI = FindDbgAddrUses(CurrentValue);
+      if (!DI.empty())
+        DIBuilder(*CurrentBlock->getParent()->getParent(),
----------------
jmorse wrote:
> jmorse wrote:
> > This might be splitting hairs, but FindDbgAddrUses will also return dbg.addr instructions, and promoting those to be dbg.declares would mess with the validity of other variable locations. Could you std::remove_if DbgAddrIntrinsic's first?
> > 
> > (I don't think this would happen with C++, but there are other IR producers).
> I'd recommend putting findDbgDeclareUses in Local.h/Local.cpp, we already have utilities there for finding {all-dbg-users, debug-values, debug-addresses}, we may as well make this available to other developers.
Awesome! I'm very glad to do so, I just wasn't sure if having one user of the interface meant it shouldn't be in a shared header. But this sounds great to me, I'll try to add a unittest for it as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75338





More information about the llvm-commits mailing list