From: Daniel Dunbar Date: Mon, 5 Jan 2009 22:14:37 +0000 (+0000) Subject: Implement getFloatingRank() for extended vectors. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d786f6a6b791b5901fa9fd39a2bbf924afbc1252;p=clang 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 --- 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;