aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-01-05 22:14:37 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-01-05 22:14:37 +0000
commitd786f6a6b791b5901fa9fd39a2bbf924afbc1252 (patch)
treeae3baa11880d4cdc7918b520dc2f1f7f2d0a45d0 /lib/AST/ASTContext.cpp
parent3ef5db646a6f66bb23146c3e506c294f31adf018 (diff)
Implement getFloatingRank() for extended vectors.
- I'm not sure this is appropriate, but it seems reasonable to be able to call getFloatingRank on anything which isFloatingType(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index c5b451740a..c76bd87c65 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1394,8 +1394,7 @@ QualType ASTContext::getArrayDecayedType(QualType Ty) {
return PtrTy.getQualifiedType(PrettyArrayType->getIndexTypeQualifier());
}
-QualType ASTContext::getBaseElementType(const VariableArrayType *VAT)
-{
+QualType ASTContext::getBaseElementType(const VariableArrayType *VAT) {
QualType ElemTy = VAT->getElementType();
if (const VariableArrayType *VAT = getAsVariableArrayType(ElemTy))
@@ -1409,7 +1408,10 @@ QualType ASTContext::getBaseElementType(const VariableArrayType *VAT)
static FloatingRank getFloatingRank(QualType T) {
if (const ComplexType *CT = T->getAsComplexType())
return getFloatingRank(CT->getElementType());
+ if (const VectorType *VT = T->getAsExtVectorType())
+ return getFloatingRank(VT->getElementType());
+ assert(T->getAsBuiltinType() && "getFloatingRank(): not a floating type");
switch (T->getAsBuiltinType()->getKind()) {
default: assert(0 && "getFloatingRank(): not a floating type");
case BuiltinType::Float: return FloatRank;