diff options
Diffstat (limited to 'Parse/Parser.cpp')
-rw-r--r-- | Parse/Parser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp index 6e03328592..8a0d8c7ecd 100644 --- a/Parse/Parser.cpp +++ b/Parse/Parser.cpp @@ -259,10 +259,11 @@ void Parser::Initialize() { /// ParseTopLevelDecl - Parse one top-level declaration, return whatever the /// action tells us to. This returns true if the EOF was encountered. -bool Parser::ParseTopLevelDecl() { +bool Parser::ParseTopLevelDecl(DeclTy*& Result) { + Result = 0; if (Tok.is(tok::eof)) return true; - ParseExternalDeclaration(); + Result = ParseExternalDeclaration(); return false; } @@ -280,7 +281,8 @@ void Parser::Finalize() { void Parser::ParseTranslationUnit() { Initialize(); - while (!ParseTopLevelDecl()) + DeclTy *Res; + while (!ParseTopLevelDecl(Res)) /*parse them all*/; Finalize(); |