Convert a bunch of actions to smart pointers, and also bring PrintParserCallbacks a bit more in line with reality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67029 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 000cb9d..f2892c1 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -625,7 +625,7 @@
case tok::kw___builtin_types_compatible_p:
return ParseBuiltinPrimaryExpression();
case tok::kw___null:
- return Owned(Actions.ActOnGNUNullExpr(ConsumeToken()));
+ return Actions.ActOnGNUNullExpr(ConsumeToken());
break;
case tok::plusplus: // unary-expression: '++' unary-expression
case tok::minusminus: { // unary-expression: '--' unary-expression
@@ -995,8 +995,7 @@
if (Ty.isInvalid())
Res = ExprError();
else
- Res = Actions.ActOnVAArg(StartLoc, Expr.release(), Ty.get(),
- ConsumeParen());
+ Res = Actions.ActOnVAArg(StartLoc, move(Expr), Ty.get(), ConsumeParen());
break;
}
case tok::kw___builtin_offsetof: {
@@ -1092,8 +1091,8 @@
Diag(Tok, diag::err_expected_rparen);
return ExprError();
}
- Res = Actions.ActOnChooseExpr(StartLoc, Cond.release(), Expr1.release(),
- Expr2.release(), ConsumeParen());
+ Res = Actions.ActOnChooseExpr(StartLoc, move(Cond), move(Expr1),
+ move(Expr2), ConsumeParen());
break;
}
case tok::kw___builtin_types_compatible_p:
@@ -1151,8 +1150,7 @@
// If the substmt parsed correctly, build the AST node.
if (!Stmt.isInvalid() && Tok.is(tok::r_paren))
- Result = Actions.ActOnStmtExpr(
- OpenLoc, Stmt.release(), Tok.getLocation());
+ Result = Actions.ActOnStmtExpr(OpenLoc, move(Stmt), Tok.getLocation());
} else if (ExprType >= CompoundLiteral && isTypeIdInParens()) {
// Otherwise, this is a compound literal expression or cast expression.
@@ -1344,7 +1342,7 @@
if (Tok.is(tok::l_brace)) {
OwningStmtResult Stmt(ParseCompoundStatementBody());
if (!Stmt.isInvalid()) {
- Result = Actions.ActOnBlockStmtExpr(CaretLoc, Stmt.release(), CurScope);
+ Result = Actions.ActOnBlockStmtExpr(CaretLoc, move(Stmt), CurScope);
} else {
Actions.ActOnBlockError(CaretLoc, CurScope);
}