Replace a bunch of static_cast + release with takeAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70566 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index de50924..af27229 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2485,7 +2485,7 @@
 
   // Take ownership of the expression, now that we're sure we have somewhere
   // to put it.
-  Expr *Init = static_cast<Expr *>(init.release());
+  Expr *Init = init.takeAs<Expr>();
   assert(Init && "missing initializer");
 
   // Get the decls type and save a reference for later, since
@@ -4274,7 +4274,7 @@
 
 Sema::DeclPtrTy Sema::ActOnFileScopeAsmDecl(SourceLocation Loc,
                                             ExprArg expr) {
-  StringLiteral *AsmString = cast<StringLiteral>((Expr*)expr.release());
+  StringLiteral *AsmString = cast<StringLiteral>(expr.takeAs<Expr>());
 
   return DeclPtrTy::make(FileScopeAsmDecl::Create(Context, CurContext,
                                                   Loc, AsmString));