@@ -307,7 +307,7 @@ unsigned DWARFVerifier::verifyDebugInfoCallSite(const DWARFDie &Die) {
307
307
308
308
if (!Curr.isValid ()) {
309
309
ErrorCategory.Report (
310
- " Call site entry not nexted within valid subprogram" , [&]() {
310
+ " Call site entry not nested within valid subprogram" , [&]() {
311
311
error () << " Call site entry not nested within a valid subprogram:" ;
312
312
Die.dump (OS);
313
313
});
@@ -339,9 +339,9 @@ unsigned DWARFVerifier::verifyAbbrevSection(const DWARFDebugAbbrev *Abbrev) {
339
339
Expected<const DWARFAbbreviationDeclarationSet *> AbbrDeclsOrErr =
340
340
Abbrev->getAbbreviationDeclarationSet (0 );
341
341
if (!AbbrDeclsOrErr) {
342
- ErrorCategory. Report ( " Abbreviation Declaration error " , [&]() {
343
- error () << toString (AbbrDeclsOrErr. takeError ()) << " \n " ;
344
- });
342
+ std::string ErrMsg = toString (AbbrDeclsOrErr. takeError ());
343
+ ErrorCategory. Report ( " Abbreviation Declaration error " ,
344
+ [&]() { error () << ErrMsg << " \n " ; });
345
345
return 1 ;
346
346
}
347
347
@@ -863,8 +863,9 @@ unsigned DWARFVerifier::verifyDebugInfoForm(const DWARFDie &Die,
863
863
case DW_FORM_line_strp: {
864
864
if (Error E = AttrValue.Value .getAsCString ().takeError ()) {
865
865
++NumErrors;
866
+ std::string ErrMsg = toString (std::move (E));
866
867
ErrorCategory.Report (" Invalid DW_FORM attribute" , [&]() {
867
- error () << toString ( std::move (E)) << " :\n " ;
868
+ error () << ErrMsg << " :\n " ;
868
869
dump (Die) << ' \n ' ;
869
870
});
870
871
}
@@ -916,7 +917,7 @@ void DWARFVerifier::verifyDebugLineStmtOffsets() {
916
917
if (LineTableOffset < DCtx.getDWARFObj ().getLineSection ().Data .size ()) {
917
918
if (!LineTable) {
918
919
++NumDebugLineErrors;
919
- ErrorCategory.Report (" Unparseable .debug_line entry" , [&]() {
920
+ ErrorCategory.Report (" Unparsable .debug_line entry" , [&]() {
920
921
error () << " .debug_line[" << format (" 0x%08" PRIx64, LineTableOffset)
921
922
<< " ] was not able to be parsed for CU:\n " ;
922
923
dump (Die) << ' \n ' ;
@@ -1584,7 +1585,7 @@ unsigned DWARFVerifier::verifyNameIndexEntries(
1584
1585
uint64_t DIEOffset = CUOffset + *EntryOr->getDIEUnitOffset ();
1585
1586
DWARFDie DIE = DCtx.getDIEForOffset (DIEOffset);
1586
1587
if (!DIE) {
1587
- ErrorCategory.Report (" NameIndex references nonexisten DIE" , [&]() {
1588
+ ErrorCategory.Report (" NameIndex references nonexistent DIE" , [&]() {
1588
1589
error () << formatv (" Name Index @ {0:x}: Entry @ {1:x} references a "
1589
1590
" non-existing DIE @ {2:x}.\n " ,
1590
1591
NI.getUnitOffset (), EntryID, DIEOffset);
@@ -1986,21 +1987,21 @@ bool DWARFVerifier::verifyDebugStrOffsets(
1986
1987
void OutputCategoryAggregator::Report (
1987
1988
StringRef s, std::function<void (void )> detailCallback) {
1988
1989
Aggregation[std::string (s)]++;
1989
- if (CallDetail )
1990
+ if (IncludeDetail )
1990
1991
detailCallback ();
1991
1992
}
1992
1993
1993
- void OutputCategoryAggregator::HandleAggregate (
1994
+ void OutputCategoryAggregator::EnumerateResults (
1994
1995
std::function<void (StringRef, unsigned )> handleCounts) {
1995
1996
for (auto &&[name, count] : Aggregation) {
1996
1997
handleCounts (name, count);
1997
1998
}
1998
1999
}
1999
2000
2000
- void DWARFVerifier::finish (bool Success) {
2001
+ void DWARFVerifier::summarize (bool Success) {
2001
2002
if (!Success && DumpOpts.ShowAggregateErrors ) {
2002
2003
error () << " Aggregated error category counts:\n " ;
2003
- ErrorCategory.HandleAggregate ([&](StringRef s, unsigned count) {
2004
+ ErrorCategory.EnumerateResults ([&](StringRef s, unsigned count) {
2004
2005
error () << " Error category '" << s << " ' occurred " << count
2005
2006
<< " time(s).\n " ;
2006
2007
});
0 commit comments