[cfe-commits] r61758 - /cfe/trunk/lib/AST/ASTContext.cpp

Daniel Dunbar daniel at zuster.org
Mon Jan 5 14:14:38 PST 2009


Author: ddunbar
Date: Mon Jan  5 16:14:37 2009
New Revision: 61758

URL: http://llvm.org/viewvc/llvm-project?rev=61758&view=rev
Log:
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().

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=61758&r1=61757&r2=61758&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Mon Jan  5 16:14:37 2009
@@ -1394,8 +1394,7 @@
   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 @@
 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;





More information about the cfe-commits mailing list