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 | 12f37e411462b8388eb1309357bd62257debacac (patch) | |
tree | cb7902a07e8652774d306fbfa61c1d5c34883eb2 /lib/Basic | |
parent | 422daa1b838788c3ef564640f9d91f52d7deffbe (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 1 | ||||
-rw-r--r-- | lib/Basic/DiagnosticIDs.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 8346e39a67..f5eec02138 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/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/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index 722d22aa38..1237fd5db1 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/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; |