summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-09-17 14:23:47 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-09-17 14:23:47 +0000
commit9d7cecfcbfec6d67ded4600dbbf21f37c818e397 (patch)
tree25935bebc030c8d9989285020f8e5e6e3ad27b06 /llvm/lib
parent481cdab9199e6459d074da14cf1818c40b9cec16 (diff)
downloadbcm5719-llvm-9d7cecfcbfec6d67ded4600dbbf21f37c818e397.tar.gz
bcm5719-llvm-9d7cecfcbfec6d67ded4600dbbf21f37c818e397.zip
[DebugInfo] Remove redundant argument. [NFC]
Removes the redundant UnitType parameter from verifyUnitContents. I also fixed some formatting issues as I was touching the file. llvm-svn: 342396
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 1f0ac6f344b..0080e7a56f4 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -93,7 +93,7 @@ bool DWARFVerifier::DieRangeInfo::intersects(const DieRangeInfo &RHS) const {
auto End = Ranges.end();
auto Iter = findRange(RHS.Ranges.front());
for (const auto &R : RHS.Ranges) {
- if(Iter == End)
+ if (Iter == End)
return false;
if (R.HighPC <= Iter->LowPC)
continue;
@@ -156,14 +156,14 @@ bool DWARFVerifier::verifyUnitHeader(const DWARFDataExtractor DebugInfoData,
OffsetStart);
if (!ValidLength)
note() << "The length for this unit is too "
- "large for the .debug_info provided.\n";
+ "large for the .debug_info provided.\n";
if (!ValidVersion)
note() << "The 16 bit unit header version is not valid.\n";
if (!ValidType)
note() << "The unit type encoding is not valid.\n";
if (!ValidAbbrevOffset)
note() << "The offset into the .debug_abbrev section is "
- "not valid.\n";
+ "not valid.\n";
if (!ValidAddrSize)
note() << "The address size is unsupported.\n";
}
@@ -171,7 +171,7 @@ bool DWARFVerifier::verifyUnitHeader(const DWARFDataExtractor DebugInfoData,
return Success;
}
-unsigned DWARFVerifier::verifyUnitContents(DWARFUnit &Unit, uint8_t UnitType) {
+unsigned DWARFVerifier::verifyUnitContents(DWARFUnit &Unit) {
unsigned NumUnitErrors = 0;
unsigned NumDies = Unit.getNumDIEs();
for (unsigned I = 0; I < NumDies; ++I) {
@@ -197,8 +197,8 @@ unsigned DWARFVerifier::verifyUnitContents(DWARFUnit &Unit, uint8_t UnitType) {
NumUnitErrors++;
}
- if (UnitType != 0 &&
- !DWARFUnit::isMatchingUnitTypeAndTag(UnitType, Die.getTag())) {
+ uint8_t UnitType = Unit.getUnitType();
+ if (!DWARFUnit::isMatchingUnitTypeAndTag(UnitType, Die.getTag())) {
error() << "Compilation unit type (" << dwarf::UnitTypeString(UnitType)
<< ") and root DIE (" << dwarf::TagString(Die.getTag())
<< ") do not match.\n";
@@ -288,8 +288,7 @@ unsigned DWARFVerifier::verifyUnitSection(const DWARFSection &S,
case dwarf::DW_UT_split_compile:
case dwarf::DW_UT_compile:
case dwarf::DW_UT_partial:
- // UnitType = 0 means that we are
- // verifying a compile unit in DWARF v4.
+ // UnitType = 0 means that we are verifying a compile unit in DWARF v4.
case 0: {
Unit.reset(new DWARFCompileUnit(
DCtx, S, Header, DCtx.getDebugAbbrev(), &DObj.getRangeSection(),
@@ -300,7 +299,7 @@ unsigned DWARFVerifier::verifyUnitSection(const DWARFSection &S,
}
default: { llvm_unreachable("Invalid UnitType."); }
}
- NumDebugInfoErrors += verifyUnitContents(*Unit, UnitType);
+ NumDebugInfoErrors += verifyUnitContents(*Unit);
}
hasDIE = DebugInfoData.isValidOffset(Offset);
++UnitIdx;
@@ -827,8 +826,8 @@ DWARFVerifier::verifyDebugNamesCULists(const DWARFDebugNames &AccelTable) {
if (Iter->second != NotIndexed) {
error() << formatv("Name Index @ {0:x} references a CU @ {1:x}, but "
- "this CU is already indexed by Name Index @ {2:x}\n",
- NI.getUnitOffset(), Offset, Iter->second);
+ "this CU is already indexed by Name Index @ {2:x}\n",
+ NI.getUnitOffset(), Offset, Iter->second);
continue;
}
Iter->second = NI.getUnitOffset();
@@ -1348,17 +1347,17 @@ bool DWARFVerifier::handleAccelTables() {
DataExtractor StrData(D.getStringSection(), DCtx.isLittleEndian(), 0);
unsigned NumErrors = 0;
if (!D.getAppleNamesSection().Data.empty())
- NumErrors +=
- verifyAppleAccelTable(&D.getAppleNamesSection(), &StrData, ".apple_names");
+ NumErrors += verifyAppleAccelTable(&D.getAppleNamesSection(), &StrData,
+ ".apple_names");
if (!D.getAppleTypesSection().Data.empty())
- NumErrors +=
- verifyAppleAccelTable(&D.getAppleTypesSection(), &StrData, ".apple_types");
+ NumErrors += verifyAppleAccelTable(&D.getAppleTypesSection(), &StrData,
+ ".apple_types");
if (!D.getAppleNamespacesSection().Data.empty())
NumErrors += verifyAppleAccelTable(&D.getAppleNamespacesSection(), &StrData,
- ".apple_namespaces");
+ ".apple_namespaces");
if (!D.getAppleObjCSection().Data.empty())
- NumErrors +=
- verifyAppleAccelTable(&D.getAppleObjCSection(), &StrData, ".apple_objc");
+ NumErrors += verifyAppleAccelTable(&D.getAppleObjCSection(), &StrData,
+ ".apple_objc");
if (!D.getDebugNamesSection().Data.empty())
NumErrors += verifyDebugNames(D.getDebugNamesSection(), StrData);
OpenPOWER on IntegriCloud