diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-23 02:06:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-23 02:06:50 +0000 |
commit | a9e8fec80088f4e176d80b84bddddfbc9ab0f548 (patch) | |
tree | 9aabee35d89cc28a00bf881da0de9990dc163aea | |
parent | 5ffb14b7e88e587cd2f78dcc3a966a64108920f0 (diff) |
add action to know about end of translation unit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55218 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Parse/Action.h | 2 | ||||
-rw-r--r-- | lib/Parse/Parser.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index ef357c9ae0..55ef67d177 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -181,6 +181,8 @@ public: return 0; } + virtual void ActOnEndOfTranslationUnit() {} + //===--------------------------------------------------------------------===// // Type Parsing Callbacks. //===--------------------------------------------------------------------===// diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index ccdf264bd8..417cc10bfb 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -285,7 +285,7 @@ bool Parser::ParseTopLevelDecl(DeclTy*& Result) { /// external-declaration /// translation-unit external-declaration void Parser::ParseTranslationUnit() { - Initialize(); + Initialize(); // pushes a scope. DeclTy *Res; while (!ParseTopLevelDecl(Res)) @@ -293,6 +293,8 @@ void Parser::ParseTranslationUnit() { ExitScope(); assert(CurScope == 0 && "Scope imbalance!"); + + Actions.ActOnEndOfTranslationUnit(); } /// ParseExternalDeclaration: |