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/Sema/SemaInit.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/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 6574524d14..c430751c2e 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -421,7 +421,7 @@ void InitListChecker::FillInValueInitializations(InitListExpr *ILE) { ElementType = AType->getElementType(); if (const ConstantArrayType *CAType = dyn_cast<ConstantArrayType>(AType)) NumElements = CAType->getSize().getZExtValue(); - } else if (const VectorType *VType = ILE->getType()->getAsVectorType()) { + } else if (const VectorType *VType = ILE->getType()->getAs<VectorType>()) { ElementType = VType->getElementType(); NumElements = VType->getNumElements(); } else @@ -499,7 +499,7 @@ void InitListChecker::CheckImplicitInitList(InitListExpr *ParentIList, else if (T->isStructureType() || T->isUnionType()) maxElements = numStructUnionElements(T); else if (T->isVectorType()) - maxElements = T->getAsVectorType()->getNumElements(); + maxElements = T->getAs<VectorType>()->getNumElements(); else assert(0 && "CheckImplicitInitList(): Illegal type"); @@ -835,7 +835,7 @@ void InitListChecker::CheckVectorType(InitListExpr *IList, QualType DeclType, InitListExpr *StructuredList, unsigned &StructuredIndex) { if (Index < IList->getNumInits()) { - const VectorType *VT = DeclType->getAsVectorType(); + const VectorType *VT = DeclType->getAs<VectorType>(); unsigned maxElements = VT->getNumElements(); unsigned numEltsInit = 0; QualType elementType = VT->getElementType(); @@ -860,7 +860,7 @@ void InitListChecker::CheckVectorType(InitListExpr *IList, QualType DeclType, StructuredList, StructuredIndex); ++numEltsInit; } else { - const VectorType *IVT = IType->getAsVectorType(); + const VectorType *IVT = IType->getAs<VectorType>(); unsigned numIElts = IVT->getNumElements(); QualType VecType = SemaRef.Context.getExtVectorType(elementType, numIElts); @@ -1625,7 +1625,7 @@ InitListChecker::getStructuredSubobjectInit(InitListExpr *IList, unsigned Index, if (NumInits && NumElements > NumInits) NumElements = 0; } - } else if (const VectorType *VType = CurrentObjectType->getAsVectorType()) + } else if (const VectorType *VType = CurrentObjectType->getAs<VectorType>()) NumElements = VType->getNumElements(); else if (const RecordType *RType = CurrentObjectType->getAs<RecordType>()) { RecordDecl *RDecl = RType->getDecl(); |