aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2008-12-11 21:36:32 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2008-12-11 21:36:32 +0000
commit2f7ece7c77eb17e24e8f0f4e1b7fb01aa5111f96 (patch)
treedb787703eed9de3896aec2c6b2d6e9444681b76a /lib/Parse/ParseObjc.cpp
parent01f2ffacc427de6bef08fe138e8cae82ba1b30a3 (diff)
Convert selected expression parsers to use smart pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 01fe558ab3..83ab371965 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -1199,7 +1199,7 @@ Parser::ParseObjCSynchronizedStmt(SourceLocation atLoc) {
return StmtError();
}
ConsumeParen(); // '('
- OwningExprResult Res(Actions, ParseExpression());
+ OwningExprResult Res(ParseExpression());
if (Res.isInvalid()) {
SkipUntil(tok::semi);
return StmtError();
@@ -1397,18 +1397,22 @@ Parser::ExprResult Parser::ParseObjCAtExpression(SourceLocation AtLoc) {
switch (Tok.getKind()) {
case tok::string_literal: // primary-expression: string-literal
case tok::wide_string_literal:
- return ParsePostfixExpressionSuffix(ParseObjCStringLiteral(AtLoc));
+ return ParsePostfixExpressionSuffix(
+ Owned(ParseObjCStringLiteral(AtLoc))).result();
default:
if (Tok.getIdentifierInfo() == 0)
return Diag(AtLoc, diag::err_unexpected_at);
-
+
switch (Tok.getIdentifierInfo()->getObjCKeywordID()) {
case tok::objc_encode:
- return ParsePostfixExpressionSuffix(ParseObjCEncodeExpression(AtLoc));
+ return ParsePostfixExpressionSuffix(
+ Owned(ParseObjCEncodeExpression(AtLoc))).result();
case tok::objc_protocol:
- return ParsePostfixExpressionSuffix(ParseObjCProtocolExpression(AtLoc));
+ return ParsePostfixExpressionSuffix(
+ Owned(ParseObjCProtocolExpression(AtLoc))).result();
case tok::objc_selector:
- return ParsePostfixExpressionSuffix(ParseObjCSelectorExpression(AtLoc));
+ return ParsePostfixExpressionSuffix(
+ Owned(ParseObjCSelectorExpression(AtLoc))).result();
default:
return Diag(AtLoc, diag::err_unexpected_at);
}
@@ -1433,7 +1437,7 @@ Parser::ExprResult Parser::ParseObjCMessageExpression() {
return ParseObjCMessageExpressionBody(LBracLoc, NameLoc, ReceiverName, 0);
}
- OwningExprResult Res(Actions, ParseExpression());
+ OwningExprResult Res(ParseExpression());
if (Res.isInvalid()) {
SkipUntil(tok::r_square);
return Res.result();
@@ -1492,7 +1496,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
ConsumeToken(); // Eat the ':'.
/// Parse the expression after ':'
- OwningExprResult Res(Actions, ParseAssignmentExpression());
+ OwningExprResult Res(ParseAssignmentExpression());
if (Res.isInvalid()) {
// We must manually skip to a ']', otherwise the expression skipper will
// stop at the ']' when it skips to the ';'. We want it to skip beyond
@@ -1514,7 +1518,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
while (Tok.is(tok::comma)) {
ConsumeToken(); // Eat the ','.
/// Parse the expression after ','
- OwningExprResult Res(Actions, ParseAssignmentExpression());
+ OwningExprResult Res(ParseAssignmentExpression());
if (Res.isInvalid()) {
// We must manually skip to a ']', otherwise the expression skipper will
// stop at the ']' when it skips to the ';'. We want it to skip beyond