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 c08f97e..b9513be 100644
--- a/include/clang/AST/ASTConsumer.h
+++ b/include/clang/AST/ASTConsumer.h
@@ -37,7 +37,10 @@
/// 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 dce577b..94e0185 100644
--- a/lib/Sema/ParseAST.cpp
+++ b/lib/Sema/ParseAST.cpp
@@ -63,6 +63,8 @@
Consumer->HandleTopLevelDecl(D);
}
};
+
+ Consumer->HandleTranslationUnit(TU);
if (PrintStats) {
fprintf(stderr, "\nSTATISTICS:\n");