diff options
author | Paul Robinson <paul.robinson@sony.com> | 2018-08-01 20:49:44 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2018-08-01 20:49:44 +0000 |
commit | 11307fab931d369dfd60d73f58a0408f1d1aa3bd (patch) | |
tree | 304648ab8a0aacdc420e9a0a4a6bc5d3d1f08c17 /llvm/lib/DebugInfo | |
parent | a7dfd483103396f4dc0ec4565bb5775495391f49 (diff) | |
download | bcm5719-llvm-11307fab931d369dfd60d73f58a0408f1d1aa3bd.tar.gz bcm5719-llvm-11307fab931d369dfd60d73f58a0408f1d1aa3bd.zip |
[DebugInfo/DWARF] [3/4] Rename DWARFUnitSection to DWARFUnitVector. NFC
This is patch 3 of 4 NFC refactorings to handle type units and compile
units more consistently and with less concern about the object-file
section that they came from.
Patch 3 simply renames DWARFUnitSection to DWARFUnitVector, as the
object-file section of a unit is nearly irrelevant now.
Differential Revision: https://reviews.llvm.org/D49743
llvm-svn: 338632
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp | 24 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp | 6 |
3 files changed, 16 insertions, 16 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index 904ceab7b28..654d205aa96 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -350,7 +350,7 @@ DWARFDie::findRecursively(ArrayRef<dwarf::Attribute> Attrs) const { 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(); diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp index c11bbba4277..671fdeb111a 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp +++ b/llvm/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 @@ void DWARFUnitSection::addUnitsForSection(DWARFContext &C, 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 @@ void DWARFUnitSection::addUnitsForDWOSection(DWARFContext &C, 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 @@ void DWARFUnitSection::addUnitsImpl( } } -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<DWARFUnit> &RHS) { @@ -116,7 +116,7 @@ DWARFUnit *DWARFUnitSection::getUnitForOffset(uint32_t Offset) const { } 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 @@ DWARFUnit::DWARFUnit(DWARFContext &DC, const DWARFSection &Section, 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(); } diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp index cf1bdc27566..d4677f60afa 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp @@ -264,7 +264,7 @@ bool DWARFVerifier::handleDebugInfo() { 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 @@ bool DWARFVerifier::handleDebugInfo() { 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 @@ bool DWARFVerifier::handleDebugInfo() { 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."); } |