[PATCH] D79571: [DebugInfo][DWARF] Emit a single location instead of a location list

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 03:43:17 PDT 2020


Orlando marked an inline comment as done.
Orlando added a comment.

Thank you both for taking a look.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1541
+    if (&*I == LScopeEnd)
+      return false;
+
----------------
aprantl wrote:
> vsk wrote:
> > aprantl wrote:
> > > Does this do the right thing if the scope is "interrupted" by another scope within MBB?
> > Hm, are you describing a situation like this, where all the code is fit into one MBB?
> > 
> > ```
> > {
> >   dbg_value "x"
> >   {
> >     dbg_value "y"
> >     ...
> >   }
> > }
> > ```
> > 
> > If the inner scope is an inlined frame, I think it'd be ok for the location of 'x' to be valid throughout, since the debugger shouldn't consider 'x' in scope. If its a nested {} scope, 'x' should still be visible within it.
> > 
> > So I think this is ok. Might be good to add tests for this, though.
> I was thinking about
> 
> ```
> MBB:
>   insn 1 # scope A
>   insn 2 # scope A
>   insn 3 # completely unrelated scope B, instruction was moved here by a transformation
>   insn 4 # scope A
> ...
> ```
I'm confident that we handle @vsk's example, but less sure about @aprantl's. I'll write up tests for both.




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

https://reviews.llvm.org/D79571





More information about the llvm-commits mailing list