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 | e6aeebb9d8f938e5be5284049bc74da6fb6319d1 (patch) | |
| tree | 6cd21b41bf577157d232b6a96bf70c08564a2021 /clang/lib/AST/ASTContext.cpp | |
| parent | 6a6aaa19177b490d96a963f7b4b573351da118fe (diff) | |
| download | bcm5719-llvm-e6aeebb9d8f938e5be5284049bc74da6fb6319d1.tar.gz bcm5719-llvm-e6aeebb9d8f938e5be5284049bc74da6fb6319d1.zip | |
Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.
llvm-svn: 118901
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 9146eb57aa9..c852482af2e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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; |

