[PATCH] D43943: [DEBUGINFO] Add flag for DWARF2 to use sections as references.

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 22 08:23:51 PDT 2018


echristo added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1579-1583
+  if (useSectionsAsReferences()) {
+    Asm->EmitLabelPlusOffset(TheU->getSection()->getBeginSymbol(),
+                             TheU->getDebugSectionOffset(),
+                             Asm->MAI->getCodePointerSize());
+  } else {
----------------
ABataev wrote:
> echristo wrote:
> > Let's refactor this into a "DwarfEmitOffset" function and use it in all of the places we want to emit a label plus an offset, then this becomes a two line patch.
> Ok, will do
Feels like you should be able to refactor the if conditional into the function as well and generally just use it everywhere?

Also means you can probably split it into two patches:

1) Add EmitDwarfOffset
2) Add support for useSectionsAsReferences

Thoughts?


Repository:
  rL LLVM

https://reviews.llvm.org/D43943





More information about the llvm-commits mailing list