[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 11:02:21 PDT 2018


vsk added a comment.

The core idea and test updates look good to me. I'm curious about the size changes: are you just measuring the size of executables, or of .o's? If it's the former, on Darwin, any size change resulting from this patch might indicate bugs.



================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1317
+static const DebugLoc &
+findNextDebugLoc(MachineBasicBlock::const_iterator MBBI,
+                 MachineBasicBlock::const_iterator MBBE) {
----------------
Why not use MachineBasicBlock::findDebugLoc?


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


Repository:
  rL LLVM

https://reviews.llvm.org/D52862





More information about the llvm-commits mailing list