Skip to content
Snippets Groups Projects
Commit b6ee44dd authored by Anna Zaks's avatar Anna Zaks
Browse files

[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
parent efe9c0df
No related branches found
No related tags found
No related merge requests found
...@@ -202,6 +202,11 @@ public: ...@@ -202,6 +202,11 @@ public:
llvm::Timer* AnalysisConsumer::TUTotalTimer = 0; llvm::Timer* AnalysisConsumer::TUTotalTimer = 0;
void AnalysisConsumer::HandleDeclContext(ASTContext &C, DeclContext *dc) { 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(); for (DeclContext::decl_iterator I = dc->decls_begin(), E = dc->decls_end();
I != E; ++I) { I != E; ++I) {
HandleDeclContextDecl(C, *I); HandleDeclContextDecl(C, *I);
...@@ -386,11 +391,6 @@ void AnalysisConsumer::HandleCode(Decl *D, SetOfDecls *VisitedCallees) { ...@@ -386,11 +391,6 @@ void AnalysisConsumer::HandleCode(Decl *D, SetOfDecls *VisitedCallees) {
DisplayFunction(D); 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 // Don't run the actions on declarations in header files unless
// otherwise specified. // otherwise specified.
SourceManager &SM = Ctx->getSourceManager(); SourceManager &SM = Ctx->getSourceManager();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment