forked from OSchip/llvm-project
[analyzer] Move the check for parser errors out of the loop over Decls.
llvm-svn: 152648
This commit is contained in:
parent
3ffe746ca8
commit
e756ce0c5d
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue