diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-07 18:47:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-07 18:47:42 +0000 |
commit | 53eee7ba970d21ff15bbd4334164037a3b4cc4b8 (patch) | |
tree | 0cf5e2b1b124846530d4d23f3fd9e3acf9f38b15 /lib/Basic/Diagnostic.cpp | |
parent | 5863b41004144470b935d18e6d52ebf11aca8597 (diff) |
Instead of counting totally diagnostics, split the count into a count
of errors and warnings. This allows us to emit something like this:
2 warnings and 1 error generated.
instead of:
3 diagnostics generated.
This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 2b7fcd07f9..a1094ad95c 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -223,8 +223,8 @@ Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) { ErrorOccurred = false; FatalErrorOccurred = false; - NumDiagnostics = 0; + NumWarnings = 0; NumErrors = 0; CustomDiagInfo = 0; CurDiagID = ~0U; @@ -555,7 +555,10 @@ bool Diagnostic::ProcessDiag() { // Finally, report it. Client->HandleDiagnostic(DiagLevel, Info); - if (Client->IncludeInDiagnosticCounts()) ++NumDiagnostics; + if (Client->IncludeInDiagnosticCounts()) { + if (DiagLevel == Diagnostic::Warning) + ++NumWarnings; + } CurDiagID = ~0U; |