diff options
author | Anna Zaks <ganna@apple.com> | 2012-03-13 19:31:47 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-03-13 19:31:47 +0000 |
commit | b6ee44dd2923fb7dac699c4bbfeded34a8604d3a (patch) | |
tree | e31ea45657ce0db2b2549e9ddff60ee29f81958c /lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | |
parent | efe9c0dffc174d92c255e1ec77f791ef007102dc (diff) |
[analyzer] Move the check for parser errors out of the loop over Decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index 7fd26894f2..54be4f7bcf 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -202,6 +202,11 @@ public: llvm::Timer* AnalysisConsumer::TUTotalTimer = 0; void AnalysisConsumer::HandleDeclContext(ASTContext &C, DeclContext *dc) { + // Don't run the actions if an error has occurred with parsing the file. + DiagnosticsEngine &Diags = PP.getDiagnostics(); + if (Diags.hasErrorOccurred() || Diags.hasFatalErrorOccurred()) + return; + for (DeclContext::decl_iterator I = dc->decls_begin(), E = dc->decls_end(); I != E; ++I) { HandleDeclContextDecl(C, *I); @@ -386,11 +391,6 @@ void AnalysisConsumer::HandleCode(Decl *D, SetOfDecls *VisitedCallees) { DisplayFunction(D); - // Don't run the actions if an error has occurred with parsing the file. - DiagnosticsEngine &Diags = PP.getDiagnostics(); - if (Diags.hasErrorOccurred() || Diags.hasFatalErrorOccurred()) - return; - // Don't run the actions on declarations in header files unless // otherwise specified. SourceManager &SM = Ctx->getSourceManager(); |