From: Ted Kremenek Date: Wed, 2 Jul 2008 18:32:45 +0000 (+0000) Subject: Added method "HandleTranslationUnit" to ASTConsumer. This is called by ParseAST... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c87190da60bca25fe3bc1fe6831916f0076b72b8;p=clang 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 --- 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");