[llvm] r196441 - Remove special handling for DW_AT_ranges support by constructing the

Eric Christopher echristo at gmail.com
Wed Dec 4 16:36:17 PST 2013


Author: echristo
Date: Wed Dec  4 18:36:17 2013
New Revision: 196441

URL: http://llvm.org/viewvc/llvm-project?rev=196441&view=rev
Log:
Remove special handling for DW_AT_ranges support by constructing the
values with the correct behavior.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=196441&r1=196440&r2=196441&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Dec  4 18:36:17 2013
@@ -465,12 +465,23 @@ bool DwarfDebug::isLexicalScopeDIENull(L
   return !End;
 }
 
+static void addSectionLabel(AsmPrinter *Asm, Unit *U, DIE *D,
+                            dwarf::Attribute A, const MCSymbol *L,
+                            const MCSymbol *Sec) {
+  if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
+    U->addSectionLabel(D, A, L);
+  else
+    U->addSectionDelta(D, A, L, Sec);
+}
+
 void DwarfDebug::addScopeRangeList(CompileUnit *TheCU, DIE *ScopeDIE,
                                    const SmallVectorImpl<InsnRange> &Range) {
   // Emit offset in .debug_range as a relocatable label. emitDIE will handle
   // emitting it appropriately.
   MCSymbol *RangeSym = Asm->GetTempSymbol("debug_ranges", GlobalRangeCount++);
-  TheCU->addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, RangeSym);
+  addSectionLabel(Asm, TheCU, ScopeDIE, dwarf::DW_AT_ranges, RangeSym,
+                  DwarfDebugRangeSectionSym);
+
   RangeSpanList List(RangeSym);
   for (SmallVectorImpl<InsnRange>::const_iterator RI = Range.begin(),
                                                   RE = Range.end();
@@ -724,15 +735,6 @@ unsigned DwarfDebug::getOrCreateSourceID
   return SrcId;
 }
 
-static void addSectionLabel(AsmPrinter *Asm, Unit *U, DIE *D,
-                            dwarf::Attribute A, const MCSymbol *L,
-                            const MCSymbol *Sec) {
-  if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
-    U->addSectionLabel(D, A, L);
-  else
-    U->addSectionDelta(D, A, L, Sec);
-}
-
 void DwarfDebug::addGnuPubAttributes(Unit *U, DIE *D) const {
   if (!GenerateGnuPubSections)
     return;
@@ -2086,16 +2088,6 @@ void DwarfDebug::emitDIE(DIE *Die, Array
       }
       break;
     }
-    case dwarf::DW_AT_ranges: {
-      // DW_AT_range Value encodes offset in debug_range section.
-      DIELabel *V = cast<DIELabel>(Values[i]);
-
-      if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
-        Asm->EmitSectionOffset(V->getValue(), DwarfDebugRangeSectionSym);
-      else
-        Asm->EmitLabelDifference(V->getValue(), DwarfDebugRangeSectionSym, 4);
-      break;
-    }
     case dwarf::DW_AT_location: {
       if (DIELabel *L = dyn_cast<DIELabel>(Values[i])) {
         if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())





More information about the llvm-commits mailing list