aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-05-01 19:49:17 +0000
committerAnders Carlsson <andersca@mac.com>2009-05-01 19:49:17 +0000
commite9146f2e9f1c4e281544e8c080934c72d41012ca (patch)
treef8781e0ab60368e1fbd949134bda081601e9aa7a /lib/Sema/SemaExpr.cpp
parentf1b1d59a3f0650ab97b04235a14ae4549ca1c656 (diff)
Replace more release+static_cast with takeAs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 5c0c33b298..8e54ef77b5 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -719,8 +719,7 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
OwningExprResult SelfExpr = ActOnIdentifierExpr(S, Loc, II, false);
return Owned(new (Context)
ObjCIvarRefExpr(IV, IV->getType(), Loc,
- static_cast<Expr*>(SelfExpr.release()),
- true, true));
+ SelfExpr.takeAs<Expr>(), true, true));
}
}
}
@@ -1221,7 +1220,7 @@ Action::OwningExprResult Sema::ActOnNumericConstant(const Token &Tok) {
Action::OwningExprResult Sema::ActOnParenExpr(SourceLocation L,
SourceLocation R, ExprArg Val) {
- Expr *E = (Expr *)Val.release();
+ Expr *E = Val.takeAs<Expr>();
assert((E != 0) && "ActOnParenExpr() missing expr");
return Owned(new (Context) ParenExpr(L, R, E));
}
@@ -4423,7 +4422,7 @@ Action::OwningExprResult Sema::ActOnBinOp(Scope *S, SourceLocation TokLoc,
tok::TokenKind Kind,
ExprArg LHS, ExprArg RHS) {
BinaryOperator::Opcode Opc = ConvertTokenKindToBinaryOpcode(Kind);
- Expr *lhs = (Expr *)LHS.release(), *rhs = (Expr*)RHS.release();
+ Expr *lhs = LHS.takeAs<Expr>(), *rhs = RHS.takeAs<Expr>();
assert((lhs != 0) && "ActOnBinOp(): missing left expression");
assert((rhs != 0) && "ActOnBinOp(): missing right expression");
@@ -4926,7 +4925,7 @@ Sema::OwningExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,
DiagnoseInvalidJumps(static_cast<CompoundStmt*>(body.get()));
CurFunctionNeedsScopeChecking = BSI->SavedFunctionNeedsScopeChecking;
- BSI->TheDecl->setBody(static_cast<CompoundStmt*>(body.release()));
+ BSI->TheDecl->setBody(body.takeAs<CompoundStmt>());
return Owned(new (Context) BlockExpr(BSI->TheDecl, BlockTy,
BSI->hasBlockDeclRefExprs));
}