diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-07-02 18:32:45 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-07-02 18:32:45 +0000 |
commit | c87190da60bca25fe3bc1fe6831916f0076b72b8 (patch) | |
tree | ad66682d4d3a4166355729b55e1ec320fea1f299 | |
parent | 902141f74ac3a2cd41966a98cd43e8702bc05ce9 (diff) |
Added method "HandleTranslationUnit" to ASTConsumer. This is called by ParseAST when all of the ASTs in a translation unit have been built.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53042 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/ASTConsumer.h | 5 | ||||
-rw-r--r-- | lib/Sema/ParseAST.cpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/AST/ASTConsumer.h b/include/clang/AST/ASTConsumer.h index c08f97e640..b9513be240 100644 --- a/include/clang/AST/ASTConsumer.h +++ b/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/lib/Sema/ParseAST.cpp b/lib/Sema/ParseAST.cpp index dce577bc4c..94e0185f03 100644 --- a/lib/Sema/ParseAST.cpp +++ b/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"); |