diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-23 03:19:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-23 03:19:52 +0000 |
commit | 9299f3fa85796613cc787a2062c9562d07c8613e (patch) | |
tree | 6d7316af2feaf7512e5e652b2b397f46a0f2b4ad /lib/Parse/Parser.cpp | |
parent | 2eecaab0fa5f569c3de82a7f04c5dc39298f472d (diff) |
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
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r-- | lib/Parse/Parser.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 417cc10bfb..a5fe551bfe 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -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: |