forked from OSchip/llvm-project
Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.
llvm-svn: 118901
This commit is contained in:
parent
6a6aaa1917
commit
e6aeebb9d8
|
@ -941,9 +941,10 @@ public:
|
|||
///
|
||||
Qualifiers::GC getObjCGCAttrKind(const QualType &Ty) const;
|
||||
|
||||
/// areCompatibleVectorTypes - Return true if the given vector types either
|
||||
/// are of the same unqualified type or if one is GCC and other - equivalent
|
||||
/// AltiVec vector type.
|
||||
/// areCompatibleVectorTypes - Return true if the given vector types
|
||||
/// are of the same unqualified type or if they are equivalent to the same
|
||||
/// GCC vector type, ignoring whether they are target-specific (AltiVec or
|
||||
/// Neon) types.
|
||||
bool areCompatibleVectorTypes(QualType FirstVec, QualType SecondVec);
|
||||
|
||||
/// isObjCNSObjectType - Return true if this is an NSObject object with
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue