[PATCH] D52862: DwarfDebug: Pick next location in case of missing location at block begin

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 5 11:32:42 PDT 2018


MatzeB marked 2 inline comments as done.
MatzeB added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1344
     return;
-  const DebugLoc &DL = MI->getDebugLoc();
+  const DebugLoc *DL = &MI->getDebugLoc();
   // When we emit a line-0 record, we don't update PrevInstLoc; so look at
----------------
vsk wrote:
> MatzeB wrote:
> > vsk wrote:
> > > DebugLoc is pointer-sized, so it's fine to just copy it instead of returning a reference. This might create a little extra traffic through TrackingMDRef's operator=, but in the common case I'd expect the optimizer to get rid of most of it.
> > I was trying to avoid unnecessary refcounting operations. But I'd happy change this to `DebugLoc DL` as that indeed makes the code look simpler.
> I don't feel strongly about this, I'll leave it to you.
I reorganized the code a bit so I don't need to switch to a pointer for reassignment and we can keep using a const reference.


Repository:
  rL LLVM

https://reviews.llvm.org/D52862





More information about the llvm-commits mailing list