aboutsummaryrefslogtreecommitdiff
path: root/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
commit8935b8b49053122ddd3ab4cd59af0fe5eb9c23cf (patch)
tree318bf0963024974c0d88316c5fa97ee64def97b8 /lib/Parse/ParseCXXInlineMethods.cpp
parent565c99f45e758406f26404e92fadd15d8b84a8c4 (diff)
Use a scoped object to manage entry/exit from a parser scope rather than explicitly calling EnterScope/ExitScope
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60830 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r--lib/Parse/ParseCXXInlineMethods.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp
index 2f5014ba50..824847af63 100644
--- a/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/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();
}
}