diff options
| author | DeLesley Hutchins <delesley@google.com> | 2012-12-07 22:53:48 +0000 |
|---|---|---|
| committer | DeLesley Hutchins <delesley@google.com> | 2012-12-07 22:53:48 +0000 |
| commit | 8ecd491e7560eb8c451220414ec849b180462105 (patch) | |
| tree | d8ecd72029bdd506d12f329eeb93d831f2b0a4e4 /clang/lib/Basic | |
| parent | 05e0ad596100a5e666f5b16b23abcac314746383 (diff) | |
| download | bcm5719-llvm-8ecd491e7560eb8c451220414ec849b180462105.tar.gz bcm5719-llvm-8ecd491e7560eb8c451220414ec849b180462105.zip | |
Fix analysis based warnings so that all warnings are emitted when compiling
with -Werror. Previously, compiling with -Werror would emit only the first
warning in a compilation unit, because clang assumes that once an error occurs,
further analysis is unlikely to return valid results. However, warnings that
have been upgraded to errors should not be treated as "errors" in this sense.
llvm-svn: 169649
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 1 | ||||
| -rw-r--r-- | clang/lib/Basic/DiagnosticIDs.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 8346e39a672..f5eec02138b 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -97,6 +97,7 @@ bool DiagnosticsEngine::popMappings(SourceLocation Loc) { void DiagnosticsEngine::Reset() { ErrorOccurred = false; + UncompilableErrorOccurred = false; FatalErrorOccurred = false; UnrecoverableErrorOccurred = false; diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp index 722d22aa384..1237fd5db19 100644 --- a/clang/lib/Basic/DiagnosticIDs.cpp +++ b/clang/lib/Basic/DiagnosticIDs.cpp @@ -628,6 +628,10 @@ bool DiagnosticIDs::ProcessDiag(DiagnosticsEngine &Diag) const { if (isUnrecoverable(DiagID)) Diag.UnrecoverableErrorOccurred = true; + // Warnings which have been upgraded to errors do not prevent compilation. + if (isDefaultMappingAsError(DiagID)) + Diag.UncompilableErrorOccurred = true; + Diag.ErrorOccurred = true; if (Diag.Client->IncludeInDiagnosticCounts()) { ++Diag.NumErrors; |

