summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-12-10 06:34:36 +0000
committerDouglas Gregor <dgregor@apple.com>2008-12-10 06:34:36 +0000
commit7307d6ca967edef535f2a9d2d3d25bb5ab14d90e (patch)
treee88e5be63348093bba99432a2fef371d5619dc98 /clang/lib/Parse/ParseDeclCXX.cpp
parent4637c3c6988d47600d556dbb51d87b48cbd7d5cf (diff)
downloadbcm5719-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/ParseDeclCXX.cpp')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index c3b94bc6289..edcbfad6f37 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -67,7 +67,7 @@ Parser::DeclTy *Parser::ParseNamespace(unsigned Context) {
SourceLocation LBrace = ConsumeBrace();
// Enter a scope for the namespace.
- EnterScope(Scope::DeclScope);
+ ParseScope NamespaceScope(this, Scope::DeclScope);
DeclTy *NamespcDecl =
Actions.ActOnStartNamespaceDef(CurScope, IdentLoc, Ident, LBrace);
@@ -76,7 +76,7 @@ Parser::DeclTy *Parser::ParseNamespace(unsigned Context) {
ParseExternalDeclaration();
// Leave the namespace scope.
- ExitScope();
+ NamespaceScope.Exit();
SourceLocation RBrace = MatchRHSPunctuation(tok::r_brace, LBrace);
Actions.ActOnFinishNamespaceDef(NamespcDecl, RBrace);
@@ -590,7 +590,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
}
// Enter a scope for the class.
- EnterScope(Scope::CXXClassScope|Scope::DeclScope);
+ ParseScope ClassScope(this, Scope::CXXClassScope|Scope::DeclScope);
Actions.ActOnStartCXXClassDef(CurScope, TagDecl, LBraceLoc);
@@ -659,7 +659,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
}
// Leave the class scope.
- ExitScope();
+ ClassScope.Exit();
Actions.ActOnFinishCXXClassDef(TagDecl);
}
OpenPOWER on IntegriCloud