DebugInfo/DWARF: Remove unused return type from DWARFUnit::extractDIEsIfNeeded

llvm-svn: 368212
This commit is contained in:
David Blaikie 2019-08-07 21:31:33 +00:00
parent 0091621e0c
commit 1b1f1d6677
2 changed files with 69 additions and 70 deletions

View File

@ -502,8 +502,8 @@ private:
}
/// extractDIEsIfNeeded - Parses a compile unit and indexes its DIEs if it
/// hasn't already been done. Returns the number of DIEs parsed at this call.
size_t extractDIEsIfNeeded(bool CUDieOnly);
/// hasn't already been done
void extractDIEsIfNeeded(bool CUDieOnly);
/// extractDIEsToVector - Appends all parsed DIEs to a vector.
void extractDIEsToVector(bool AppendCUDie, bool AppendNonCUDIEs,

View File

@ -401,19 +401,21 @@ void DWARFUnit::extractDIEsToVector(
getOffset(), DIEOffset);
}
size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
void DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
if ((CUDieOnly && !DieArray.empty()) ||
DieArray.size() > 1)
return 0; // Already parsed.
return; // Already parsed.
bool HasCUDie = !DieArray.empty();
extractDIEsToVector(!HasCUDie, !CUDieOnly, DieArray);
if (DieArray.empty())
return 0;
return;
// If CU DIE was just parsed, copy several attribute values from it.
if (!HasCUDie) {
if (HasCUDie)
return;
DWARFDie UnitDie = getUnitDIE();
if (Optional<uint64_t> DWOId = toUnsigned(UnitDie.find(DW_AT_GNU_dwo_id)))
Header.setDWOId(*DWOId);
@ -441,7 +443,8 @@ size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
IsDWO ? determineStringOffsetsTableContributionDWO(DA)
: determineStringOffsetsTableContribution(DA);
if (!StringOffsetOrError) {
WithColor::error() << "invalid contribution to string offsets table in section .debug_str_offsets[.dwo]: "
WithColor::error() << "invalid contribution to string offsets table in "
"section .debug_str_offsets[.dwo]: "
<< toString(StringOffsetOrError.takeError()) << '\n';
} else {
StringOffsetsTableContribution = *StringOffsetOrError;
@ -466,8 +469,7 @@ size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
RngListTable = TableOrError.get();
else
WithColor::error() << "parsing a range list table: "
<< toString(TableOrError.takeError())
<< '\n';
<< toString(TableOrError.takeError()) << '\n';
// In a split dwarf unit, there is no DW_AT_rnglists_base attribute.
// Adjust RangeSectionBase to point past the table header.
@ -480,9 +482,6 @@ size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
// skeleton CU DIE, so that DWARF users not aware of it are not broken.
}
return DieArray.size();
}
bool DWARFUnit::parseDWO() {
if (IsDWO)
return false;