make sure that ParseAST invokes the action for end of translation unit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-08-23 03:19:52 +00:00
Родитель 2eecaab0fa
Коммит 9299f3fa85
4 изменённых файлов: 17 добавлений и 3 удалений

Просмотреть файл

@ -181,6 +181,9 @@ public:
return 0;
}
/// ActOnEndOfTranslationUnit - This is called at the very end of the
/// translation unit when EOF is reached and all but the top-level scope is
/// popped.
virtual void ActOnEndOfTranslationUnit() {}
//===--------------------------------------------------------------------===//

Просмотреть файл

@ -274,7 +274,10 @@ void Parser::Initialize() {
/// action tells us to. This returns true if the EOF was encountered.
bool Parser::ParseTopLevelDecl(DeclTy*& Result) {
Result = 0;
if (Tok.is(tok::eof)) return true;
if (Tok.is(tok::eof)) {
Actions.ActOnEndOfTranslationUnit();
return true;
}
Result = ParseExternalDeclaration();
return false;
@ -293,8 +296,6 @@ void Parser::ParseTranslationUnit() {
ExitScope();
assert(CurScope == 0 && "Scope imbalance!");
Actions.ActOnEndOfTranslationUnit();
}
/// ParseExternalDeclaration:

Просмотреть файл

@ -129,6 +129,14 @@ void Sema::DeleteStmt(StmtTy *S) {
delete static_cast<Stmt*>(S);
}
/// ActOnEndOfTranslationUnit - This is called at the very end of the
/// translation unit when EOF is reached and all but the top-level scope is
/// popped.
void Sema::ActOnEndOfTranslationUnit() {
}
//===----------------------------------------------------------------------===//
// Helper functions.
//===----------------------------------------------------------------------===//

Просмотреть файл

@ -197,6 +197,8 @@ public:
virtual void DeleteExpr(ExprTy *E);
virtual void DeleteStmt(StmtTy *S);
virtual void ActOnEndOfTranslationUnit();
//===--------------------------------------------------------------------===//
// Type Analysis / Processing: SemaType.cpp.
//