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/ExprConstant.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/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 8df52c9377..9c34547db1 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -487,7 +487,7 @@ static bool EvaluateVector(const Expr* E, APValue& Result, EvalInfo &Info) { } APValue VectorExprEvaluator::VisitCastExpr(const CastExpr* E) { - const VectorType *VTy = E->getType()->getAsVectorType(); + const VectorType *VTy = E->getType()->getAs<VectorType>(); QualType EltTy = VTy->getElementType(); unsigned NElts = VTy->getNumElements(); unsigned EltWidth = Info.Ctx.getTypeSize(EltTy); @@ -566,7 +566,7 @@ VectorExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) { APValue VectorExprEvaluator::VisitInitListExpr(const InitListExpr *E) { - const VectorType *VT = E->getType()->getAsVectorType(); + const VectorType *VT = E->getType()->getAs<VectorType>(); unsigned NumInits = E->getNumInits(); unsigned NumElements = VT->getNumElements(); @@ -599,7 +599,7 @@ VectorExprEvaluator::VisitInitListExpr(const InitListExpr *E) { APValue VectorExprEvaluator::GetZeroVector(QualType T) { - const VectorType *VT = T->getAsVectorType(); + const VectorType *VT = T->getAs<VectorType>(); QualType EltTy = VT->getElementType(); APValue ZeroElement; if (EltTy->isIntegerType()) @@ -1575,7 +1575,7 @@ public: APValue VisitCastExpr(CastExpr *E) { Expr* SubExpr = E->getSubExpr(); - QualType EltType = E->getType()->getAsComplexType()->getElementType(); + QualType EltType = E->getType()->getAs<ComplexType>()->getElementType(); QualType SubType = SubExpr->getType(); if (SubType->isRealFloatingType()) { @@ -1612,7 +1612,7 @@ public: Zero = 0; return APValue(Result, Zero); } - } else if (const ComplexType *CT = SubType->getAsComplexType()) { + } else if (const ComplexType *CT = SubType->getAs<ComplexType>()) { APValue Src; if (!EvaluateComplex(SubExpr, Src, Info)) |