From 5ec0b37419afa35869ce3a859302386c65e55557 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 3 Nov 2014 16:40:43 +0000 Subject: [PATCH] Sink DwarfUnit::CURanges into DwarfCompileUnit llvm-svn: 221161 --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 6 ++++++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 2 +- lib/CodeGen/AsmPrinter/DwarfUnit.h | 7 ------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index d193ad805f7..53be5188398 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -52,6 +52,9 @@ class DwarfCompileUnit : public DwarfUnit { // the CU itself. SmallVector CURangeLists; + // List of ranges for a given compile unit. + SmallVector CURanges; + /// \brief Construct a DIE for the given DbgVariable without initializing the /// DbgVariable's DIE reference. std::unique_ptr constructVariableDIEImpl(const DbgVariable &DV, @@ -233,6 +236,9 @@ public: return CURangeLists; } SmallVectorImpl &getRangeLists() { return CURangeLists; } + + /// getRanges - Get the list of ranges for this unit. + const SmallVectorImpl &getRanges() const { return CURanges; } }; } // end llvm namespace diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 91f62b8ad6f..2b432c035cb 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -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()); } } diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h index 6c79dc25372..141d22b735c 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -107,9 +107,6 @@ protected: /// corresponds to the MDNode mapped with the subprogram DIE. DenseMap ContainingTypeMap; - // List of ranges for a given compile unit. - SmallVector 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 &getRanges() const { return CURanges; } - SmallVectorImpl &getRanges() { return CURanges; } - /// getParentContextString - Get a string containing the language specific /// context for a global name. std::string getParentContextString(DIScope Context) const;