aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/ASTConsumer.h5
-rw-r--r--lib/Sema/ParseAST.cpp2
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");