[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
Thu Oct 4 11:26:53 PDT 2018


MatzeB marked 3 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:
> 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.


Repository:
  rL LLVM

https://reviews.llvm.org/D52862





More information about the llvm-commits mailing list