[cfe-commits] r102778 - in /cfe/trunk/lib: Frontend/AnalysisConsumer.cpp Sema/AnalysisBasedWarnings.cpp
Ted Kremenek
kremenek at apple.com
Fri Apr 30 14:49:25 PDT 2010
Author: kremenek
Date: Fri Apr 30 16:49:25 2010
New Revision: 102778
URL: http://llvm.org/viewvc/llvm-project?rev=102778&view=rev
Log:
Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
fatal error has occurred.
Modified:
cfe/trunk/lib/Frontend/AnalysisConsumer.cpp
cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
Modified: cfe/trunk/lib/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/AnalysisConsumer.cpp?rev=102778&r1=102777&r2=102778&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/AnalysisConsumer.cpp Fri Apr 30 16:49:25 2010
@@ -41,10 +41,6 @@
static ExplodedNode::Auditor* CreateUbiViz();
//===----------------------------------------------------------------------===//
-// Basic type definitions.
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
// Special PathDiagnosticClients.
//===----------------------------------------------------------------------===//
@@ -276,7 +272,8 @@
void AnalysisConsumer::HandleCode(Decl *D, Stmt* Body, Actions& actions) {
// Don't run the actions if an error has occured with parsing the file.
- if (PP.getDiagnostics().hasErrorOccurred())
+ Diagnostic &Diags = PP.getDiagnostics();
+ if (Diags.hasErrorOccurred() || Diags.hasFatalErrorOccurred())
return;
// Don't run the actions on declarations in header files unless
Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=102778&r1=102777&r2=102778&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Fri Apr 30 16:49:25 2010
@@ -345,12 +345,14 @@
// don't bother trying.
// (2) The code already has problems; running the analysis just takes more
// time.
- if (S.getDiagnostics().hasErrorOccurred())
+ Diagnostic &Diags = S.getDiagnostics();
+
+ if (Diags.hasErrorOccurred() || Diags.hasFatalErrorOccurred())
return;
// Do not do any analysis for declarations in system headers if we are
// going to just ignore them.
- if (S.getDiagnostics().getSuppressSystemWarnings() &&
+ if (Diags.getSuppressSystemWarnings() &&
S.SourceMgr.isInSystemHeader(D->getLocation()))
return;
More information about the cfe-commits
mailing list