@@ -1941,14 +1941,12 @@ unsigned DWARFVerifier::verifyNameIndexCompleteness(
19411941 if (none_of (NI.equal_range (Name), [&](const DWARFDebugNames::Entry &E) {
19421942 return E.getDIEUnitOffset () == DieUnitOffset;
19431943 })) {
1944- ErrorCategory.Report (
1945- " Name Index DIE entry missing name" ,
1946- llvm::dwarf::TagString (Die.getTag ()), [&]() {
1947- error () << formatv (
1948- " Name Index @ {0:x}: Entry for DIE @ {1:x} ({2}) with "
1949- " name {3} missing.\n " ,
1950- NI.getUnitOffset (), Die.getOffset (), Die.getTag (), Name);
1951- });
1944+ ErrorCategory.Report (" Name Index DIE entry missing name" , [&]() {
1945+ error () << formatv (
1946+ " Name Index @ {0:x}: Entry for DIE @ {1:x} ({2}) with "
1947+ " name {3} missing.\n " ,
1948+ NI.getUnitOffset (), Die.getOffset (), Die.getTag (), Name);
1949+ });
19521950 ++NumErrors;
19531951 }
19541952 }
@@ -2170,35 +2168,15 @@ bool DWARFVerifier::verifyDebugStrOffsets(
21702168
21712169void OutputCategoryAggregator::Report (
21722170 StringRef s, std::function<void (void )> detailCallback) {
2173- this ->Report (s, " " , detailCallback);
2174- }
2175-
2176- void OutputCategoryAggregator::Report (
2177- StringRef category, StringRef sub_category,
2178- std::function<void (void )> detailCallback) {
2179- std::string category_str = std::string (category);
2180- AggregationData *Agg = &Aggregation[category_str];
2181- Agg->OverallCount ++;
2182- if (!sub_category.empty ()) {
2183- Agg->DetailedCounts [std::string (sub_category)]++;
2184- }
2171+ Aggregation[std::string (s)]++;
21852172 if (IncludeDetail)
21862173 detailCallback ();
21872174}
21882175
21892176void OutputCategoryAggregator::EnumerateResults (
21902177 std::function<void (StringRef, unsigned )> handleCounts) {
2191- for (auto &&[name, aggData] : Aggregation) {
2192- handleCounts (name, aggData.OverallCount );
2193- }
2194- }
2195- void OutputCategoryAggregator::EnumerateDetailedResultsFor (
2196- StringRef category, std::function<void (StringRef, unsigned )> handleCounts) {
2197- auto Agg = Aggregation.find (std::string (category));
2198- if (Agg != Aggregation.end ()) {
2199- for (auto &&[name, count] : Agg->second .DetailedCounts ) {
2200- handleCounts (name, count);
2201- }
2178+ for (auto &&[name, count] : Aggregation) {
2179+ handleCounts (name, count);
22022180 }
22032181}
22042182
@@ -2225,12 +2203,6 @@ void DWARFVerifier::summarize() {
22252203 ErrorCategory.EnumerateResults ([&](StringRef Category, unsigned Count) {
22262204 llvm::json::Object Val;
22272205 Val.try_emplace (" count" , Count);
2228- llvm::json::Object Details;
2229- ErrorCategory.EnumerateDetailedResultsFor (
2230- Category, [&](StringRef SubCategory, unsigned SubCount) {
2231- Details.try_emplace (SubCategory, SubCount);
2232- });
2233- Val.try_emplace (" details" , std::move (Details));
22342206 Categories.try_emplace (Category, std::move (Val));
22352207 ErrorCount += Count;
22362208 });
0 commit comments