Sink DwarfUnit::CURanges into DwarfCompileUnit
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 3 Nov 2014 16:40:43 +0000 (16:40 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 3 Nov 2014 16:40:43 +0000 (16:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221161 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h

index d193ad805f7f83b2fc3473274c7997f98a568da3..53be518839839ce7a2b3a43361db409b158031ee 100644 (file)
@@ -52,6 +52,9 @@ class DwarfCompileUnit : public DwarfUnit {
   // the CU itself.
   SmallVector<RangeSpanList, 1> CURangeLists;
 
+  // List of ranges for a given compile unit.
+  SmallVector<RangeSpan, 1> CURanges;
+
   /// \brief Construct a DIE for the given DbgVariable without initializing the
   /// DbgVariable's DIE reference.
   std::unique_ptr<DIE> constructVariableDIEImpl(const DbgVariable &DV,
@@ -233,6 +236,9 @@ public:
     return CURangeLists;
   }
   SmallVectorImpl<RangeSpanList> &getRangeLists() { return CURangeLists; }
+
+  /// getRanges - Get the list of ranges for this unit.
+  const SmallVectorImpl<RangeSpan> &getRanges() const { return CURanges; }
 };
 
 } // end llvm namespace
index 91f62b8ad6ffb7933741ef904669c8aa071ad097..2b432c035cb1504dddf4df387472eec905d24f74 100644 (file)
@@ -591,7 +591,7 @@ void DwarfDebug::finalizeModuleInfo() {
         // 2.17.3).
         U.addUInt(U.getUnitDie(), dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, 0);
       } else {
-        RangeSpan &Range = TheCU.getRanges().back();
+        const RangeSpan &Range = TheCU.getRanges().back();
         U.attachLowHighPC(U.getUnitDie(), Range.getStart(), Range.getEnd());
       }
     }
index 6c79dc253729d3dd2e0afab10420f31cfe49d762..141d22b735c393a6a8e7004100ba0094118aff88 100644 (file)
@@ -107,9 +107,6 @@ protected:
   /// corresponds to the MDNode mapped with the subprogram DIE.
   DenseMap<DIE *, const MDNode *> ContainingTypeMap;
 
-  // List of ranges for a given compile unit.
-  SmallVector<RangeSpan, 1> CURanges;
-
   // DIEValueAllocator - All DIEValues are allocated through this allocator.
   BumpPtrAllocator DIEValueAllocator;
 
@@ -149,10 +146,6 @@ public:
   /// hasContent - Return true if this compile unit has something to write out.
   bool hasContent() const { return !UnitDie.getChildren().empty(); }
 
-  /// getRanges - Get the list of ranges for this unit.
-  const SmallVectorImpl<RangeSpan> &getRanges() const { return CURanges; }
-  SmallVectorImpl<RangeSpan> &getRanges() { return CURanges; }
-
   /// getParentContextString - Get a string containing the language specific
   /// context for a global name.
   std::string getParentContextString(DIScope Context) const;