[PATCH] D43627: [DEBUGINFO] Add flag for DWARF2 or less to use sections as references.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 14:02:39 PST 2018


JDevlieghere added a comment.

I really hate to go on about this, but the truth is that I've been told this so many times that it instantly caught my eye. 😀



================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:274
+  const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
+  if (DD->useSectionsAsReferences()) {
+    LineTableStartSym = TLOF.getDwarfLineSection()->getBeginSymbol();
----------------
ABataev wrote:
> JDevlieghere wrote:
> > ABataev wrote:
> > > JDevlieghere wrote:
> > > > The LLVM coding standard says not to put braces around single statement blocks. 
> > > Only if there is no `else` branch with multiple line substatement. In this case, both substatements must be enclosed in braces. 
> > But that's not the case here, is it?
> Why not? The `else` substatement is 2-line.
It's still a **single** statement, only it that happens to be split across two lines, which doesn't affect whether we need braces. 


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1580
+  if (useSectionsAsReferences()) {
+    Asm->EmitLabelPlusOffset(TheU->getSection()->getBeginSymbol(),
+                             TheU->getDebugSectionOffset(),
----------------
Same here


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1584
+  } else {
+    Asm->emitDwarfSymbolReference(TheU->getLabelBegin());
+  }
----------------
And here


Repository:
  rL LLVM

https://reviews.llvm.org/D43627





More information about the llvm-commits mailing list