[llvm] r219372 - Push DwarfDebug::attachRangesOrLowHighPC down into DwarfCompileUnit

David Blaikie dblaikie at gmail.com
Wed Oct 8 17:21:42 PDT 2014


Author: dblaikie
Date: Wed Oct  8 19:21:42 2014
New Revision: 219372

URL: http://llvm.org/viewvc/llvm-project?rev=219372&view=rev
Log:
Push DwarfDebug::attachRangesOrLowHighPC down into DwarfCompileUnit

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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=219372&r1=219371&r2=219372&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Wed Oct  8 19:21:42 2014
@@ -421,4 +421,14 @@ DwarfCompileUnit::addScopeRangeList(DIE
   addRangeList(std::move(List));
 }
 
+void DwarfCompileUnit::attachRangesOrLowHighPC(
+    DIE &Die, const SmallVectorImpl<InsnRange> &Ranges) {
+  assert(!Ranges.empty());
+  if (Ranges.size() == 1)
+    attachLowHighPC(Die, DD->getLabelBeforeInsn(Ranges.front().first),
+                    DD->getLabelAfterInsn(Ranges.front().second));
+  else
+    addScopeRangeList(Die, Ranges);
+}
+
 } // end llvm namespace

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=219372&r1=219371&r2=219372&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Wed Oct  8 19:21:42 2014
@@ -86,6 +86,9 @@ public:
   /// lexical scope.
   void addScopeRangeList(DIE &ScopeDIE,
                          const SmallVectorImpl<InsnRange> &Range);
+
+  void attachRangesOrLowHighPC(DIE &D,
+                               const SmallVectorImpl<InsnRange> &Ranges);
 };
 
 } // end llvm namespace

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=219372&r1=219371&r2=219372&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Oct  8 19:21:42 2014
@@ -330,16 +330,6 @@ bool DwarfDebug::isLexicalScopeDIENull(L
   return !getLabelAfterInsn(Ranges.front().second);
 }
 
-void DwarfDebug::attachRangesOrLowHighPC(DwarfCompileUnit &TheCU, DIE &Die,
-                                    const SmallVectorImpl<InsnRange> &Ranges) {
-  assert(!Ranges.empty());
-  if (Ranges.size() == 1)
-    TheCU.attachLowHighPC(Die, getLabelBeforeInsn(Ranges.front().first),
-                          getLabelAfterInsn(Ranges.front().second));
-  else
-    TheCU.addScopeRangeList(Die, Ranges);
-}
-
 // Construct new DW_TAG_lexical_block for this scope and attach
 // DW_AT_low_pc/DW_AT_high_pc labels.
 std::unique_ptr<DIE>
@@ -352,7 +342,7 @@ DwarfDebug::constructLexicalScopeDIE(Dwa
   if (Scope->isAbstractScope())
     return ScopeDIE;
 
-  attachRangesOrLowHighPC(TheCU, *ScopeDIE, Scope->getRanges());
+  TheCU.attachRangesOrLowHighPC(*ScopeDIE, Scope->getRanges());
 
   return ScopeDIE;
 }
@@ -373,7 +363,7 @@ DwarfDebug::constructInlinedScopeDIE(Dwa
   auto ScopeDIE = make_unique<DIE>(dwarf::DW_TAG_inlined_subroutine);
   TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, *OriginDIE);
 
-  attachRangesOrLowHighPC(TheCU, *ScopeDIE, Scope->getRanges());
+  TheCU.attachRangesOrLowHighPC(*ScopeDIE, Scope->getRanges());
 
   // Add the call site information to the DIE.
   DILocation DL(Scope->getInlinedAt());

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=219372&r1=219371&r2=219372&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed Oct  8 19:21:42 2014
@@ -518,9 +518,6 @@ class DwarfDebug : public AsmPrinterHand
     LabelsAfterInsn.insert(std::make_pair(MI, nullptr));
   }
 
-  void attachRangesOrLowHighPC(DwarfCompileUnit &Unit, DIE &D,
-                               const SmallVectorImpl<InsnRange> &Ranges);
-
 public:
   //===--------------------------------------------------------------------===//
   // Main entry points.





More information about the llvm-commits mailing list