summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseCXXInlineMethods.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/ParseCXXInlineMethods.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/ParseCXXInlineMethods.cpp')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 2f5014ba504..824847af63b 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -65,7 +65,7 @@ Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, Declarator &D) {
/// (non-nested) C++ class. Now go over the stack of lexed methods that were
/// collected during its parsing and parse them all.
void Parser::ParseLexedMethodDefs() {
- while (!getCurTopClassStack().empty()) {
+ for (; !getCurTopClassStack().empty(); getCurTopClassStack().pop()) {
LexedMethod &LM = getCurTopClassStack().top();
assert(!LM.Toks.empty() && "Empty body!");
@@ -81,15 +81,13 @@ void Parser::ParseLexedMethodDefs() {
// Parse the method body. Function body parsing code is similar enough
// to be re-used for method bodies as well.
- EnterScope(Scope::FnScope|Scope::DeclScope);
+ ParseScope FnScope(this, Scope::FnScope|Scope::DeclScope);
Actions.ActOnStartOfFunctionDef(CurScope, LM.D);
if (Tok.is(tok::colon))
ParseConstructorInitializer(LM.D);
ParseFunctionStatementBody(LM.D, Tok.getLocation(), Tok.getLocation());
-
- getCurTopClassStack().pop();
}
}
OpenPOWER on IntegriCloud