summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-09-21 23:43:11 +0000
committerJohn McCall <rjmccall@apple.com>2009-09-21 23:43:11 +0000
commit9dd450bb781484ca4b870529f89842541045c153 (patch)
treeb2033fb4eef5442d9d080df4ae39137b696dcd4e /clang/lib/Sema/SemaInit.cpp
parentfd68c7bdc0ea3a61b90380eab3db89230c6b5f27 (diff)
downloadbcm5719-llvm-9dd450bb781484ca4b870529f89842541045c153.tar.gz
bcm5719-llvm-9dd450bb781484ca4b870529f89842541045c153.zip
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. llvm-svn: 82501
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 6574524d14d..c430751c2e2 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud