Simplify debug_loc.dwo handling slightly.
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 1 Apr 2014 16:09:49 +0000 (16:09 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 1 Apr 2014 16:09:49 +0000 (16:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205322 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DIE.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h

index 34f070e0edbf905f1e2eab1a8ccc28c75a1809b3..cea9df14dfceaf192da5ed21233a68cdfb286c32 100644 (file)
@@ -562,9 +562,7 @@ void DIELocList::EmitValue(AsmPrinter *AP, dwarf::Form Form) const {
   DwarfDebug *DD = AP->getDwarfDebug();
   MCSymbol *Label = AP->GetTempSymbol("debug_loc", Index);
 
-  if (DD->useSplitDwarf())
-    AP->EmitLabelDifference(Label, DD->getDebugLocDWOSym(), 4);
-  else if (AP->MAI->doesDwarfUseRelocationsAcrossSections())
+  if (AP->MAI->doesDwarfUseRelocationsAcrossSections() && !DD->useSplitDwarf())
     AP->EmitSectionOffset(Label, DD->getDebugLocSym());
   else
     AP->EmitLabelDifference(Label, DD->getDebugLocSym(), 4);
index a21fa673118386582b17a4e5545fc6cfa69d9d98..7cb2567db2668d1ab6b6998f0c1821d963e8e68f 100644 (file)
@@ -1893,7 +1893,7 @@ void DwarfDebug::emitSectionLabels() {
         emitSectionSym(Asm, TLOF.getDwarfStrDWOSection(), "skel_string");
     DwarfAddrSectionSym =
         emitSectionSym(Asm, TLOF.getDwarfAddrSection(), "addr_sec");
-    DwarfDebugLocDWOSectionSym =
+    DwarfDebugLocSectionSym =
         emitSectionSym(Asm, TLOF.getDwarfLocDWOSection(), "skel_loc");
   } else
     DwarfDebugLocSectionSym =
index 0b0f0a8b7aadc00d2f550d7b21b014013508b4fb..064c0fa7624b716798df6b4ea3f6a36eb259c608 100644 (file)
@@ -423,7 +423,7 @@ class DwarfDebug : public AsmPrinterHandler {
   MCSymbol *DwarfDebugLocSectionSym, *DwarfLineSectionSym, *DwarfAddrSectionSym;
   MCSymbol *FunctionBeginSym, *FunctionEndSym;
   MCSymbol *DwarfInfoDWOSectionSym, *DwarfAbbrevDWOSectionSym;
-  MCSymbol *DwarfStrDWOSectionSym, *DwarfDebugLocDWOSectionSym;
+  MCSymbol *DwarfStrDWOSectionSym;
   MCSymbol *DwarfGnuPubNamesSectionSym, *DwarfGnuPubTypesSectionSym;
 
   // As an optimization, there is no need to emit an entry in the directory
@@ -756,9 +756,6 @@ public:
   /// Returns the section symbol for the .debug_loc section.
   MCSymbol *getDebugLocSym() const { return DwarfDebugLocSectionSym; }
 
-  /// Returns the section symbol for the .debug_loc section.
-  MCSymbol *getDebugLocDWOSym() const { return DwarfDebugLocDWOSectionSym; }
-
   /// Returns the previous section that was emitted into.
   const MCSection *getPrevSection() const { return PrevSection; }