Index: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h =================================================================== --- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h +++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h @@ -22,9 +22,9 @@ const DWARFDebugAbbrev *DA, const DWARFSection *RS, StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, const DWARFSection &LS, bool LE, - bool IsDWO, const DWARFUnitSection &UnitSection) + bool IsDWO, const DWARFUnitVector &UnitVector) : DWARFUnit(Context, Section, Header, DA, RS, SS, SOS, AOS, LS, LE, IsDWO, - UnitSection) {} + UnitVector) {} /// VTable anchor. ~DWARFCompileUnit() override; Index: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFContext.h =================================================================== --- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFContext.h +++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFContext.h @@ -57,8 +57,8 @@ /// This data structure is the top level entity that deals with dwarf debug /// information parsing. The actual data is supplied through DWARFObj. class DWARFContext : public DIContext { - DWARFUnitSection CUs; - DWARFUnitSection TUs; + DWARFUnitVector CUs; + DWARFUnitVector TUs; std::unique_ptr CUIndex; std::unique_ptr GdbIndex; std::unique_ptr TUIndex; @@ -75,8 +75,8 @@ std::unique_ptr AppleNamespaces; std::unique_ptr AppleObjC; - DWARFUnitSection DWOCUs; - DWARFUnitSection DWOTUs; + DWARFUnitVector DWOCUs; + DWARFUnitVector DWOTUs; std::unique_ptr AbbrevDWO; std::unique_ptr LocDWO; @@ -139,8 +139,8 @@ bool verify(raw_ostream &OS, DIDumpOptions DumpOpts = {}) override; - using cu_iterator_range = DWARFUnitSection::iterator_range; - using tu_iterator_range = DWARFUnitSection::iterator_range; + using cu_iterator_range = DWARFUnitVector::iterator_range; + using tu_iterator_range = DWARFUnitVector::iterator_range; /// Get compile units in this context. cu_iterator_range compile_units() { Index: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h =================================================================== --- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h +++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h @@ -278,8 +278,8 @@ /// Helper to allow for parsing of an entire .debug_line section in sequence. class SectionParser { public: - using cu_range = DWARFUnitSection::iterator_range; - using tu_range = DWARFUnitSection::iterator_range; + using cu_range = DWARFUnitVector::iterator_range; + using tu_range = DWARFUnitVector::iterator_range; using LineToUnitMap = std::map; SectionParser(DWARFDataExtractor &Data, const DWARFContext &C, cu_range CUs, Index: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h =================================================================== --- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h +++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h @@ -30,9 +30,9 @@ const DWARFDebugAbbrev *DA, const DWARFSection *RS, StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, const DWARFSection &LS, bool LE, bool IsDWO, - const DWARFUnitSection &UnitSection) + const DWARFUnitVector &UnitVector) : DWARFUnit(Context, Section, Header, DA, RS, SS, SOS, AOS, LS, LE, IsDWO, - UnitSection) {} + UnitVector) {} uint64_t getTypeHash() const { return getHeader().getTypeHash(); } uint32_t getTypeOffset() const { return getHeader().getTypeOffset(); } Index: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h =================================================================== --- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h +++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h @@ -105,7 +105,7 @@ DWARFSectionKind Kind); /// Describes one section's Units. -class DWARFUnitSection final : public SmallVector, 1> { +class DWARFUnitVector final : public SmallVector, 1> { std::function(uint32_t, const DWARFSection *)> Parser; @@ -176,7 +176,7 @@ uint32_t AddrOffsetSectionBase = 0; bool isLittleEndian; bool isDWO; - const DWARFUnitSection &UnitSection; + const DWARFUnitVector &UnitVector; /// Start, length, and DWARF format of the unit's contribution to the string /// offsets table (DWARF v5). @@ -233,7 +233,7 @@ const DWARFDebugAbbrev *DA, const DWARFSection *RS, StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, const DWARFSection &LS, bool LE, bool IsDWO, - const DWARFUnitSection &UnitSection); + const DWARFUnitVector &UnitVector); virtual ~DWARFUnit(); @@ -389,8 +389,8 @@ void getInlinedChainForAddress(uint64_t Address, SmallVectorImpl &InlinedChain); - /// getUnitSection - Return the DWARFUnitSection containing this unit. - const DWARFUnitSection &getUnitSection() const { return UnitSection; } + /// Return the DWARFUnitVector containing this unit. + const DWARFUnitVector &getUnitVector() const { return UnitVector; } /// Returns the number of DIEs in the unit. Parses the unit /// if necessary. Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp =================================================================== --- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -350,7 +350,7 @@ DWARFDie DWARFDie::getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const { if (auto SpecRef = toReference(find(Attr))) { - if (auto SpecUnit = U->getUnitSection().getUnitForOffset(*SpecRef)) + if (auto SpecUnit = U->getUnitVector().getUnitForOffset(*SpecRef)) return SpecUnit->getDIEForOffset(*SpecRef); } return DWARFDie(); Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp =================================================================== --- llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp @@ -33,9 +33,9 @@ using namespace llvm; using namespace dwarf; -void DWARFUnitSection::addUnitsForSection(DWARFContext &C, - const DWARFSection &Section, - DWARFSectionKind SectionKind) { +void DWARFUnitVector::addUnitsForSection(DWARFContext &C, + const DWARFSection &Section, + DWARFSectionKind SectionKind) { const DWARFObject &D = C.getDWARFObj(); addUnitsImpl(C, D, Section, C.getDebugAbbrev(), &D.getRangeSection(), D.getStringSection(), D.getStringOffsetSection(), @@ -43,10 +43,10 @@ false, false, SectionKind); } -void DWARFUnitSection::addUnitsForDWOSection(DWARFContext &C, - const DWARFSection &DWOSection, - DWARFSectionKind SectionKind, - bool Lazy) { +void DWARFUnitVector::addUnitsForDWOSection(DWARFContext &C, + const DWARFSection &DWOSection, + DWARFSectionKind SectionKind, + bool Lazy) { const DWARFObject &D = C.getDWARFObj(); addUnitsImpl(C, D, DWOSection, C.getDebugAbbrevDWO(), &D.getRangeDWOSection(), D.getStringDWOSection(), D.getStringOffsetDWOSection(), @@ -54,7 +54,7 @@ true, Lazy, SectionKind); } -void DWARFUnitSection::addUnitsImpl( +void DWARFUnitVector::addUnitsImpl( DWARFContext &Context, const DWARFObject &Obj, const DWARFSection &Section, const DWARFDebugAbbrev *DA, const DWARFSection *RS, StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, const DWARFSection &LS, @@ -104,7 +104,7 @@ } } -DWARFUnit *DWARFUnitSection::getUnitForOffset(uint32_t Offset) const { +DWARFUnit *DWARFUnitVector::getUnitForOffset(uint32_t Offset) const { auto *CU = std::upper_bound( this->begin(), this->end(), Offset, [](uint32_t LHS, const std::unique_ptr &RHS) { @@ -116,7 +116,7 @@ } DWARFUnit * -DWARFUnitSection::getUnitForIndexEntry(const DWARFUnitIndex::Entry &E) { +DWARFUnitVector::getUnitForIndexEntry(const DWARFUnitIndex::Entry &E) { const auto *CUOff = E.getOffset(DW_SECT_INFO); if (!CUOff) return nullptr; @@ -148,11 +148,11 @@ const DWARFDebugAbbrev *DA, const DWARFSection *RS, StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, const DWARFSection &LS, bool LE, - bool IsDWO, const DWARFUnitSection &UnitSection) + bool IsDWO, const DWARFUnitVector &UnitVector) : Context(DC), InfoSection(Section), Header(Header), Abbrev(DA), RangeSection(RS), LineSection(LS), StringSection(SS), StringOffsetSection(SOS), AddrOffsetSection(AOS), isLittleEndian(LE), - isDWO(IsDWO), UnitSection(UnitSection) { + isDWO(IsDWO), UnitVector(UnitVector) { clear(); } Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp =================================================================== --- llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp @@ -264,7 +264,7 @@ bool isUnitDWARF64 = false; bool isHeaderChainValid = true; bool hasDIE = DebugInfoData.isValidOffset(Offset); - DWARFUnitSection UnitSection{}; + DWARFUnitVector UnitVector{}; while (hasDIE) { OffsetStart = Offset; if (!verifyUnitHeader(DebugInfoData, &Offset, UnitIdx, UnitType, @@ -283,7 +283,7 @@ DCtx, DObj.getInfoSection(), Header, DCtx.getDebugAbbrev(), &DObj.getRangeSection(), DObj.getStringSection(), DObj.getStringOffsetSection(), &DObj.getAppleObjCSection(), - DObj.getLineSection(), DCtx.isLittleEndian(), false, UnitSection)); + DObj.getLineSection(), DCtx.isLittleEndian(), false, UnitVector)); break; } case dwarf::DW_UT_skeleton: @@ -297,7 +297,7 @@ DCtx, DObj.getInfoSection(), Header, DCtx.getDebugAbbrev(), &DObj.getRangeSection(), DObj.getStringSection(), DObj.getStringOffsetSection(), &DObj.getAppleObjCSection(), - DObj.getLineSection(), DCtx.isLittleEndian(), false, UnitSection)); + DObj.getLineSection(), DCtx.isLittleEndian(), false, UnitVector)); break; } default: { llvm_unreachable("Invalid UnitType."); }