Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely.  Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 60458b4..6e46c4f 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -51,7 +51,7 @@
 
     std::string Proto = FD->getQualifiedNameAsString(Policy);
 
-    const FunctionType *AFT = FD->getType()->getAsFunctionType();
+    const FunctionType *AFT = FD->getType()->getAs<FunctionType>();
     const FunctionProtoType *FT = 0;
     if (FD->hasWrittenPrototype())
       FT = dyn_cast<FunctionProtoType>(AFT);
@@ -335,7 +335,7 @@
   else if (const BlockPointerType *BPT = CalleeType->getAs<BlockPointerType>())
     CalleeType = BPT->getPointeeType();
 
-  const FunctionType *FnType = CalleeType->getAsFunctionType();
+  const FunctionType *FnType = CalleeType->getAs<FunctionType>();
   return FnType->getResultType();
 }
 
@@ -575,7 +575,7 @@
 ///
 const FunctionType *BlockExpr::getFunctionType() const {
   return getType()->getAs<BlockPointerType>()->
-                    getPointeeType()->getAsFunctionType();
+                    getPointeeType()->getAs<FunctionType>();
 }
 
 SourceLocation BlockExpr::getCaretLocation() const {
@@ -1693,7 +1693,7 @@
 }
 
 unsigned ExtVectorElementExpr::getNumElements() const {
-  if (const VectorType *VT = getType()->getAsVectorType())
+  if (const VectorType *VT = getType()->getAs<VectorType>())
     return VT->getNumElements();
   return 1;
 }