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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 4 12:28:19 PDT 2018


vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.

Looks great, thanks!



================
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
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D52862





More information about the llvm-commits mailing list