diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-11-12 17:24:54 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-11-12 17:24:54 +0000 |
commit | f69eb7cf8e616b5aad7911ec6f79b24b0a009227 (patch) | |
tree | a79cfda994516ce9bcb6a589b4d7f2fa393b6726 /lib/AST/ASTContext.cpp | |
parent | cc3b946c35c4372272034e6f0663089477a9a5bd (diff) |
Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 9146eb57aa..c852482af2 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -4284,15 +4284,16 @@ bool ASTContext::areCompatibleVectorTypes(QualType FirstVec, if (hasSameUnqualifiedType(FirstVec, SecondVec)) return true; - // AltiVec vectors types are identical to equivalent GCC vector types + // Treat Neon vector types and most AltiVec vector types as if they are the + // equivalent GCC vector types. const VectorType *First = FirstVec->getAs<VectorType>(); const VectorType *Second = SecondVec->getAs<VectorType>(); - if ((((First->getVectorKind() == VectorType::AltiVecVector) && - (Second->getVectorKind() == VectorType::GenericVector)) || - ((First->getVectorKind() == VectorType::GenericVector) && - (Second->getVectorKind() == VectorType::AltiVecVector))) && + if (First->getNumElements() == Second->getNumElements() && hasSameType(First->getElementType(), Second->getElementType()) && - (First->getNumElements() == Second->getNumElements())) + First->getVectorKind() != VectorType::AltiVecPixel && + First->getVectorKind() != VectorType::AltiVecBool && + Second->getVectorKind() != VectorType::AltiVecPixel && + Second->getVectorKind() != VectorType::AltiVecBool) return true; return false; |