@@ -1298,7 +1298,7 @@ void DWARFVerifier::verifyNameIndexBuckets(const DWARFDebugNames::NameIndex &NI,
1298
1298
// each Name is reachable from the appropriate bucket.
1299
1299
std::vector<BucketInfo> BucketStarts;
1300
1300
BucketStarts.reserve (NI.getBucketCount () + 1 );
1301
- const unsigned OrigNumberOfErrors = ErrorCategory.GetNumErrors ();
1301
+ const uint64_t OrigNumberOfErrors = ErrorCategory.GetNumErrors ();
1302
1302
for (uint32_t Bucket = 0 , End = NI.getBucketCount (); Bucket < End; ++Bucket) {
1303
1303
uint32_t Index = NI.getBucketArrayEntry (Bucket);
1304
1304
if (Index > NI.getNameCount ()) {
@@ -1516,12 +1516,16 @@ void DWARFVerifier::verifyNameIndexAbbrevs(
1516
1516
}
1517
1517
}
1518
1518
1519
- static SmallVector<std::string, 3 > getNames (const DWARFDie &DIE,
1520
- bool IncludeStrippedTemplateNames,
1521
- bool IncludeObjCNames = true ,
1522
- bool IncludeLinkageName = true ) {
1519
+ SmallVector<std::string, 3 >
1520
+ DWARFVerifier::getNames (const DWARFDie &DIE, bool IncludeStrippedTemplateNames,
1521
+ bool IncludeObjCNames, bool IncludeLinkageName) {
1523
1522
SmallVector<std::string, 3 > Result;
1524
- if (const char *Str = DIE.getShortName ()) {
1523
+ const char *Str = nullptr ;
1524
+ {
1525
+ std::lock_guard<std::mutex> Lock (AccessMutex);
1526
+ Str = DIE.getShortName ();
1527
+ }
1528
+ if (Str) {
1525
1529
StringRef Name (Str);
1526
1530
Result.emplace_back (Name);
1527
1531
if (IncludeStrippedTemplateNames) {
@@ -1695,15 +1699,12 @@ void DWARFVerifier::verifyNameIndexEntries(
1695
1699
// NonSkeletonUnitDie to point to the actual type unit in the .dwo/.dwp.
1696
1700
NonSkeletonUnit =
1697
1701
NonSkeletonDCtx.getTypeUnitForHash (TypeSig, /* IsDWO=*/ true );
1698
- DWARFDie NonSkeletonUnitDie = DWARFDie ();
1699
- {
1700
- std::lock_guard<std::mutex> Lock (AccessMutex);
1701
- NonSkeletonUnitDie = NonSkeletonUnit->getUnitDIE (true );
1702
- }
1703
1702
// If we have foreign type unit in a DWP file, then we need to ignore
1704
1703
// any entries from type units that don't match the one that made it into
1705
1704
// the .dwp file.
1706
1705
if (NonSkeletonDCtx.isDWP ()) {
1706
+ std::lock_guard<std::mutex> Lock (AccessMutex);
1707
+ DWARFDie NonSkeletonUnitDie = NonSkeletonUnit->getUnitDIE (true );
1707
1708
StringRef DUDwoName = dwarf::toStringRef (
1708
1709
UnitDie.find ({DW_AT_dwo_name, DW_AT_GNU_dwo_name}));
1709
1710
StringRef TUDwoName = dwarf::toStringRef (
@@ -1958,7 +1959,7 @@ void DWARFVerifier::verifyDebugNames(const DWARFSection &AccelSection,
1958
1959
[&]() { error () << Msg << ' \n ' ; });
1959
1960
return ;
1960
1961
}
1961
- const unsigned OriginalNumErrors = ErrorCategory.GetNumErrors ();
1962
+ const uint64_t OriginalNumErrors = ErrorCategory.GetNumErrors ();
1962
1963
verifyDebugNamesCULists (AccelTable);
1963
1964
for (const auto &NI : AccelTable)
1964
1965
verifyNameIndexBuckets (NI, StrData);
0 commit comments