add action to know about end of translation unit.

llvm-svn: 55218
This commit is contained in:
Chris Lattner 2008-08-23 02:06:50 +00:00
parent ce90ef51b9
commit 9e8c057ab7
2 changed files with 5 additions and 1 deletions

View File

@ -181,6 +181,8 @@ public:
return 0;
}
virtual void ActOnEndOfTranslationUnit() {}
//===--------------------------------------------------------------------===//
// Type Parsing Callbacks.
//===--------------------------------------------------------------------===//

View File

@ -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: