зеркало из https://github.com/microsoft/clang-1.git
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:
Родитель
2eecaab0fa
Коммит
9299f3fa85
|
@ -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.
|
||||
//
|
||||
|
|
Загрузка…
Ссылка в новой задаче