Skip to content

Commit a1f3441

Browse files
committed
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(). llvm-svn: 61758
1 parent c0a1900 commit a1f3441

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,7 @@ QualType ASTContext::getArrayDecayedType(QualType Ty) {
13941394
return PtrTy.getQualifiedType(PrettyArrayType->getIndexTypeQualifier());
13951395
}
13961396

1397-
QualType ASTContext::getBaseElementType(const VariableArrayType *VAT)
1398-
{
1397+
QualType ASTContext::getBaseElementType(const VariableArrayType *VAT) {
13991398
QualType ElemTy = VAT->getElementType();
14001399

14011400
if (const VariableArrayType *VAT = getAsVariableArrayType(ElemTy))
@@ -1409,7 +1408,10 @@ QualType ASTContext::getBaseElementType(const VariableArrayType *VAT)
14091408
static FloatingRank getFloatingRank(QualType T) {
14101409
if (const ComplexType *CT = T->getAsComplexType())
14111410
return getFloatingRank(CT->getElementType());
1411+
if (const VectorType *VT = T->getAsExtVectorType())
1412+
return getFloatingRank(VT->getElementType());
14121413

1414+
assert(T->getAsBuiltinType() && "getFloatingRank(): not a floating type");
14131415
switch (T->getAsBuiltinType()->getKind()) {
14141416
default: assert(0 && "getFloatingRank(): not a floating type");
14151417
case BuiltinType::Float: return FloatRank;

0 commit comments

Comments
 (0)