diff options
| author | Douglas Gregor <dgregor@apple.com> | 2008-12-10 06:34:36 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2008-12-10 06:34:36 +0000 |
| commit | 7307d6ca967edef535f2a9d2d3d25bb5ab14d90e (patch) | |
| tree | e88e5be63348093bba99432a2fef371d5619dc98 /clang/lib/Parse/Parser.cpp | |
| parent | 4637c3c6988d47600d556dbb51d87b48cbd7d5cf (diff) | |
| download | bcm5719-llvm-7307d6ca967edef535f2a9d2d3d25bb5ab14d90e.tar.gz bcm5719-llvm-7307d6ca967edef535f2a9d2d3d25bb5ab14d90e.zip | |
Use a scoped object to manage entry/exit from a parser scope rather than explicitly calling EnterScope/ExitScope
llvm-svn: 60830
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
| -rw-r--r-- | clang/lib/Parse/Parser.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index d040efd7acd..3d72b60b867 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -287,7 +287,7 @@ bool Parser::ParseTopLevelDecl(DeclTy*& Result) { /// external-declaration /// translation-unit external-declaration void Parser::ParseTranslationUnit() { - Initialize(); // pushes a scope. + Initialize(); DeclTy *Res; while (!ParseTopLevelDecl(Res)) @@ -526,7 +526,7 @@ Parser::DeclTy *Parser::ParseFunctionDefinition(Declarator &D) { } // Enter a scope for the function body. - EnterScope(Scope::FnScope|Scope::DeclScope); + ParseScope BodyScope(this, Scope::FnScope|Scope::DeclScope); // Tell the actions module that we have entered a function definition with the // specified Declarator for the function. @@ -549,7 +549,7 @@ void Parser::ParseKNRParamDeclarations(Declarator &D) { // Enter function-declaration scope, limiting any declarators to the // function prototype scope, including parameter declarators. - EnterScope(Scope::FnScope|Scope::DeclScope); + ParseScope PrototypeScope(this, Scope::FnScope|Scope::DeclScope); // Read all the argument declarations. while (isDeclarationSpecifier()) { @@ -653,9 +653,6 @@ void Parser::ParseKNRParamDeclarations(Declarator &D) { } } - // Leave prototype scope. - ExitScope(); - // The actions module must verify that all arguments were declared. } |

