From 0e818a412f337baa35d1d7677c64259610df0c2e Mon Sep 17 00:00:00 2001 From: Anna Zaks <ganna@apple.com> Date: Fri, 16 Dec 2011 18:28:45 +0000 Subject: [PATCH] Fixup to the relaxed diagnostic verification option r146633. We should exit when matching the '+' even if nothing was found to prevent searching for all UNIT_MAX items. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146747 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/VerifyDiagnosticConsumer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Frontend/VerifyDiagnosticConsumer.cpp b/lib/Frontend/VerifyDiagnosticConsumer.cpp index 1676a44c46f..96c990c54f2 100644 --- a/lib/Frontend/VerifyDiagnosticConsumer.cpp +++ b/lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -443,8 +443,10 @@ static unsigned CheckLists(DiagnosticsEngine &Diags, SourceManager &SourceMgr, break; } if (II == IE) { - if (D.Count == D.OneOrMoreCount && FoundOnce) { - // We are only interested in at least one match and we found one. + if (D.Count == D.OneOrMoreCount) { + if (!FoundOnce) + LeftOnly.push_back(*I); + // We are only interested in at least one match, so exit the loop. break; } // Not found. -- GitLab