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 | 198cb4df6e583e8bf74aca570cf657577164f239 (patch) | |
tree | 44f86c7a9cb2cb0d149e543c243c9d61f1e17513 /clang/lib/Basic | |
parent | a503f7c9d2a065cf497ccaa87060320494152415 (diff) | |
download | bcm5719-llvm-198cb4df6e583e8bf74aca570cf657577164f239.tar.gz bcm5719-llvm-198cb4df6e583e8bf74aca570cf657577164f239.zip |
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.
llvm-svn: 100675
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 2b7fcd07f9d..a1094ad95ca 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/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; |