1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[DebugInfo] Rename getOffset() to getContribution(). NFC.

The old name was a bit misleading because the functions actually return
contributions to the corresponding sections.

Differential revision: https://reviews.llvm.org/D77302
This commit is contained in:
Igor Kudrin 2020-04-02 19:39:56 +07:00
parent d33f7a7cb5
commit bdcd84e3f3
5 changed files with 14 additions and 14 deletions

View File

@ -487,7 +487,7 @@ public:
uint32_t getLineTableOffset() const {
if (auto IndexEntry = Header.getIndexEntry())
if (const auto *Contrib = IndexEntry->getOffset(DW_SECT_LINE))
if (const auto *Contrib = IndexEntry->getContribution(DW_SECT_LINE))
return Contrib->Offset;
return 0;
}

View File

@ -56,10 +56,10 @@ public:
friend class DWARFUnitIndex;
public:
const SectionContribution *getOffset(DWARFSectionKind Sec) const;
const SectionContribution *getOffset() const;
const SectionContribution *getContribution(DWARFSectionKind Sec) const;
const SectionContribution *getContribution() const;
const SectionContribution *getOffsets() const {
const SectionContribution *getContributions() const {
return Contributions.get();
}

View File

@ -139,7 +139,7 @@ DWARFUnit *DWARFUnitVector::getUnitForOffset(uint64_t Offset) const {
DWARFUnit *
DWARFUnitVector::getUnitForIndexEntry(const DWARFUnitIndex::Entry &E) {
const auto *CUOff = E.getOffset(DW_SECT_INFO);
const auto *CUOff = E.getContribution(DW_SECT_INFO);
if (!CUOff)
return nullptr;
@ -183,7 +183,7 @@ DWARFUnit::DWARFUnit(DWARFContext &DC, const DWARFSection &Section,
// data based on the index entries.
StringRef Data = LocSection->Data;
if (auto *IndexEntry = Header.getIndexEntry())
if (const auto *C = IndexEntry->getOffset(DW_SECT_LOC))
if (const auto *C = IndexEntry->getContribution(DW_SECT_LOC))
Data = Data.substr(C->Offset, C->Length);
DWARFDataExtractor DWARFData =
@ -294,11 +294,11 @@ bool DWARFUnitHeader::extract(DWARFContext &Context,
if (IndexEntry) {
if (AbbrOffset)
return false;
auto *UnitContrib = IndexEntry->getOffset();
auto *UnitContrib = IndexEntry->getContribution();
if (!UnitContrib ||
UnitContrib->Length != (Length + getUnitLengthFieldByteSize()))
return false;
auto *AbbrEntry = IndexEntry->getOffset(DW_SECT_ABBREV);
auto *AbbrEntry = IndexEntry->getContribution(DW_SECT_ABBREV);
if (!AbbrEntry)
return false;
AbbrOffset = AbbrEntry->Offset;
@ -966,7 +966,7 @@ DWARFUnit::determineStringOffsetsTableContributionDWO(DWARFDataExtractor & DA) {
uint64_t Offset = 0;
auto IndexEntry = Header.getIndexEntry();
const auto *C =
IndexEntry ? IndexEntry->getOffset(DW_SECT_STR_OFFSETS) : nullptr;
IndexEntry ? IndexEntry->getContribution(DW_SECT_STR_OFFSETS) : nullptr;
if (C)
Offset = C->Offset;
if (getVersion() >= 5) {

View File

@ -154,7 +154,7 @@ void DWARFUnitIndex::dump(raw_ostream &OS) const {
}
const DWARFUnitIndex::Entry::SectionContribution *
DWARFUnitIndex::Entry::getOffset(DWARFSectionKind Sec) const {
DWARFUnitIndex::Entry::getContribution(DWARFSectionKind Sec) const {
uint32_t i = 0;
for (; i != Index->Header.NumColumns; ++i)
if (Index->ColumnKinds[i] == Sec)
@ -163,7 +163,7 @@ DWARFUnitIndex::Entry::getOffset(DWARFSectionKind Sec) const {
}
const DWARFUnitIndex::Entry::SectionContribution *
DWARFUnitIndex::Entry::getOffset() const {
DWARFUnitIndex::Entry::getContribution() const {
return &Contributions[Index->InfoColumn];
}

View File

@ -219,7 +219,7 @@ struct UnitIndexEntry {
static StringRef getSubsection(StringRef Section,
const DWARFUnitIndex::Entry &Entry,
DWARFSectionKind Kind) {
const auto *Off = Entry.getOffset(Kind);
const auto *Off = Entry.getContribution(Kind);
if (!Off)
return StringRef();
return Section.substr(Off->Offset, Off->Length);
@ -231,7 +231,7 @@ static void addAllTypesFromDWP(
const UnitIndexEntry &TUEntry, uint32_t &TypesOffset) {
Out.SwitchSection(OutputTypes);
for (const DWARFUnitIndex::Entry &E : TUIndex.getRows()) {
auto *I = E.getOffsets();
auto *I = E.getContributions();
if (!I)
continue;
auto P = TypeIndexEntries.insert(std::make_pair(E.getSignature(), TUEntry));
@ -599,7 +599,7 @@ static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
return make_error<DWPError>("failed to parse cu_index");
for (const DWARFUnitIndex::Entry &E : CUIndex.getRows()) {
auto *I = E.getOffsets();
auto *I = E.getContributions();
if (!I)
continue;
auto P = IndexEntries.insert(std::make_pair(E.getSignature(), CurEntry));