diff options
author | John McCall <rjmccall@apple.com> | 2009-09-21 23:43:11 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-09-21 23:43:11 +0000 |
commit | 183700f494ec9b6701b6efe82bcb25f4c79ba561 (patch) | |
tree | 797f214407f66937802226652d130f95d596e33b /lib/AST/Expr.cpp | |
parent | c32b24452ebb537934b20b7133a3a0cbce447666 (diff) |
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
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 60458b4fb6..6e46c4f701 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -51,7 +51,7 @@ std::string PredefinedExpr::ComputeName(ASTContext &Context, IdentType IT, 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 @@ QualType CallExpr::getCallReturnType() const { 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 @@ Expr *InitListExpr::updateInit(unsigned Init, Expr *expr) { /// const FunctionType *BlockExpr::getFunctionType() const { return getType()->getAs<BlockPointerType>()-> - getPointeeType()->getAsFunctionType(); + getPointeeType()->getAs<FunctionType>(); } SourceLocation BlockExpr::getCaretLocation() const { @@ -1693,7 +1693,7 @@ bool ExtVectorElementExpr::isArrow() const { } unsigned ExtVectorElementExpr::getNumElements() const { - if (const VectorType *VT = getType()->getAsVectorType()) + if (const VectorType *VT = getType()->getAs<VectorType>()) return VT->getNumElements(); return 1; } |