]> granicus.if.org Git - clang/commitdiff
Implement getFloatingRank() for extended vectors.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 5 Jan 2009 22:14:37 +0000 (22:14 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 5 Jan 2009 22:14:37 +0000 (22:14 +0000)
 - 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

lib/AST/ASTContext.cpp

index c5b451740a28841de8541670cad8c3da4bbf3565..c76bd87c65555ea886940495ba9afe4bacb7c80d 100644 (file)
@@ -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;