aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExpr.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/ParseExpr.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/ParseExpr.cpp')
-rw-r--r--lib/Parse/ParseExpr.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 4cf7c1e4f7..9babd10ed0 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -1159,8 +1159,8 @@ Parser::ExprResult Parser::ParseBlockLiteralExpression() {
// argument decls, decls within the compound expression, etc. This also
// allows determining whether a variable reference inside the block is
// within or outside of the block.
- EnterScope(Scope::BlockScope|Scope::FnScope|Scope::BreakScope|
- Scope::ContinueScope|Scope::DeclScope);
+ ParseScope BlockScope(this, Scope::BlockScope|Scope::FnScope|Scope::BreakScope|
+ Scope::ContinueScope|Scope::DeclScope);
// Inform sema that we are starting a block.
Actions.ActOnBlockStart(CaretLoc, CurScope);
@@ -1179,7 +1179,6 @@ Parser::ExprResult Parser::ParseBlockLiteralExpression() {
// If there was an error parsing the arguments, they may have tried to use
// ^(x+y) which requires an argument list. Just skip the whole block
// literal.
- ExitScope();
return true;
}
} else {
@@ -1200,7 +1199,6 @@ Parser::ExprResult Parser::ParseBlockLiteralExpression() {
Actions.ActOnBlockError(CaretLoc, CurScope);
}
}
- ExitScope();
return Result.result();
}