Convert more expression actions to smart pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62537 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 08cb0dd..dc95c38 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -315,12 +315,12 @@
// Combine the LHS and RHS into the LHS (e.g. build AST).
if (TernaryMiddle.isInvalid())
LHS = Actions.ActOnBinOp(CurScope, OpToken.getLocation(),
- OpToken.getKind(), LHS.release(),
- RHS.release());
+ OpToken.getKind(), move_arg(LHS),
+ move_arg(RHS));
else
LHS = Actions.ActOnConditionalOp(OpToken.getLocation(), ColonLoc,
- LHS.release(), TernaryMiddle.release(),
- RHS.release());
+ move_arg(LHS), move_arg(TernaryMiddle),
+ move_arg(RHS));
}
}
}
@@ -472,7 +472,7 @@
Res = ParseCastExpression(false);
if (!Res.isInvalid())
Res = Actions.ActOnCastExpr(LParenLoc, CastTy, RParenLoc,
- Res.release());
+ move_arg(Res));
return move(Res);
}
@@ -1097,11 +1097,11 @@
Result = ParseInitializer();
ExprType = CompoundLiteral;
if (!Result.isInvalid())
- return Owned(Actions.ActOnCompoundLiteral(OpenLoc, Ty, RParenLoc,
- Result.release()));
+ return Actions.ActOnCompoundLiteral(OpenLoc, Ty, RParenLoc,
+ move_arg(Result));
return move(Result);
}
-
+
if (ExprType == CastExpr) {
// Note that this doesn't parse the subsequence cast-expression, it just
// returns the parsed type to the callee.
@@ -1109,7 +1109,7 @@
CastTy = Ty;
return OwningExprResult(Actions);
}
-
+
Diag(Tok, diag::err_expected_lbrace_in_compound_literal);
return ExprError();
} else {
diff --git a/lib/Parse/ParseInit.cpp b/lib/Parse/ParseInit.cpp
index 9b93c18..ff73b0b 100644
--- a/lib/Parse/ParseInit.cpp
+++ b/lib/Parse/ParseInit.cpp
@@ -253,8 +253,8 @@
if (Tok.is(tok::r_brace)) {
Diag(LBraceLoc, diag::ext_gnu_empty_initializer);
// Match the '}'.
- return Owned(Actions.ActOnInitList(LBraceLoc, 0, 0, InitExprDesignations,
- ConsumeBrace()));
+ return Actions.ActOnInitList(LBraceLoc, Action::MultiExprArg(Actions),
+ InitExprDesignations, ConsumeBrace());
}
bool InitExprsOk = true;
@@ -309,9 +309,8 @@
if (Tok.is(tok::r_brace)) break;
}
if (InitExprsOk && Tok.is(tok::r_brace))
- return Owned(Actions.ActOnInitList(LBraceLoc, InitExprs.take(),
- InitExprs.size(),
- InitExprDesignations, ConsumeBrace()));
+ return Actions.ActOnInitList(LBraceLoc, move_arg(InitExprs),
+ InitExprDesignations, ConsumeBrace());
// Match the '}'.
MatchRHSPunctuation(tok::r_brace, LBraceLoc);