diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/AST/ASTConsumer.h | 5 | ||||
| -rw-r--r-- | clang/lib/Sema/ParseAST.cpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/include/clang/AST/ASTConsumer.h b/clang/include/clang/AST/ASTConsumer.h index c08f97e6409..b9513be240b 100644 --- a/clang/include/clang/AST/ASTConsumer.h +++ b/clang/include/clang/AST/ASTConsumer.h @@ -37,7 +37,10 @@ public: /// HandleTopLevelDecl - Handle the specified top-level declaration. This is /// called by HandleTopLevelDeclaration to process every top-level Decl*. virtual void HandleTopLevelDecl(Decl *D) {} - + + /// HandleTranslationUnit - This method is called when the ASTs for entire + /// translation unit have been parsed. + virtual void HandleTranslationUnit(TranslationUnit& TU) {} /// HandleTopLevelDeclaration - Handle the specified top-level declaration. /// This is called only for Decl* that are the head of a chain of diff --git a/clang/lib/Sema/ParseAST.cpp b/clang/lib/Sema/ParseAST.cpp index dce577bc4c2..94e0185f03f 100644 --- a/clang/lib/Sema/ParseAST.cpp +++ b/clang/lib/Sema/ParseAST.cpp @@ -63,6 +63,8 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer, bool PrintStats) { Consumer->HandleTopLevelDecl(D); } }; + + Consumer->HandleTranslationUnit(TU); if (PrintStats) { fprintf(stderr, "\nSTATISTICS:\n"); |

