aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-11-10 21:56:12 +0000
committerBob Wilson <bob.wilson@apple.com>2010-11-10 21:56:12 +0000
commite86d78cf4754a6aef2cf9a33d847aa15338e276f (patch)
tree97c6cec0fbcf3f47aac7a2da135e0ab500c1fe9a /lib/AST/ASTContext.cpp
parenta66d3bb056932868dac7ac76d6ed22b09281bc80 (diff)
Add a variant of GCC-style vector types for ARM NEON.
NEON vector types need to be mangled in a special way to comply with ARM's ABI, similar to some of the AltiVec-specific vector types. This patch is mostly just renaming a bunch of "AltiVecSpecific" things, since they will no longer be specific to AltiVec. Besides that, it just adds the new "NeonVector" enum. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index c9c7e5c2af..9146eb57aa 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1602,7 +1602,7 @@ QualType ASTContext::getIncompleteArrayType(QualType EltTy,
/// getVectorType - Return the unique reference to a vector type of
/// the specified element type and size. VectorType must be a built-in type.
QualType ASTContext::getVectorType(QualType vecType, unsigned NumElts,
- VectorType::AltiVecSpecific AltiVecSpec) {
+ VectorType::VectorKind VecKind) {
BuiltinType *BaseType;
BaseType = dyn_cast<BuiltinType>(getCanonicalType(vecType).getTypePtr());
@@ -1610,7 +1610,7 @@ QualType ASTContext::getVectorType(QualType vecType, unsigned NumElts,
// Check if we've already instantiated a vector of this type.
llvm::FoldingSetNodeID ID;
- VectorType::Profile(ID, vecType, NumElts, Type::Vector, AltiVecSpec);
+ VectorType::Profile(ID, vecType, NumElts, Type::Vector, VecKind);
void *InsertPos = 0;
if (VectorType *VTP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos))
@@ -1621,14 +1621,14 @@ QualType ASTContext::getVectorType(QualType vecType, unsigned NumElts,
QualType Canonical;
if (!vecType.isCanonical()) {
Canonical = getVectorType(getCanonicalType(vecType), NumElts,
- VectorType::NotAltiVec);
+ VectorType::GenericVector);
// Get the new insert position for the node we care about.
VectorType *NewIP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos);
assert(NewIP == 0 && "Shouldn't be in the map!"); NewIP = NewIP;
}
VectorType *New = new (*this, TypeAlignment)
- VectorType(vecType, NumElts, Canonical, AltiVecSpec);
+ VectorType(vecType, NumElts, Canonical, VecKind);
VectorTypes.InsertNode(New, InsertPos);
Types.push_back(New);
return QualType(New, 0);
@@ -1645,7 +1645,7 @@ QualType ASTContext::getExtVectorType(QualType vecType, unsigned NumElts) {
// Check if we've already instantiated a vector of this type.
llvm::FoldingSetNodeID ID;
VectorType::Profile(ID, vecType, NumElts, Type::ExtVector,
- VectorType::NotAltiVec);
+ VectorType::GenericVector);
void *InsertPos = 0;
if (VectorType *VTP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos))
return QualType(VTP, 0);
@@ -4287,10 +4287,10 @@ bool ASTContext::areCompatibleVectorTypes(QualType FirstVec,
// AltiVec vectors types are identical to equivalent GCC vector types
const VectorType *First = FirstVec->getAs<VectorType>();
const VectorType *Second = SecondVec->getAs<VectorType>();
- if ((((First->getAltiVecSpecific() == VectorType::AltiVec) &&
- (Second->getAltiVecSpecific() == VectorType::NotAltiVec)) ||
- ((First->getAltiVecSpecific() == VectorType::NotAltiVec) &&
- (Second->getAltiVecSpecific() == VectorType::AltiVec))) &&
+ if ((((First->getVectorKind() == VectorType::AltiVecVector) &&
+ (Second->getVectorKind() == VectorType::GenericVector)) ||
+ ((First->getVectorKind() == VectorType::GenericVector) &&
+ (Second->getVectorKind() == VectorType::AltiVecVector))) &&
hasSameType(First->getElementType(), Second->getElementType()) &&
(First->getNumElements() == Second->getNumElements()))
return true;
@@ -5243,7 +5243,7 @@ QualType ASTContext::getCorrespondingUnsignedType(QualType T) {
// Turn <4 x signed int> -> <4 x unsigned int>
if (const VectorType *VTy = T->getAs<VectorType>())
return getVectorType(getCorrespondingUnsignedType(VTy->getElementType()),
- VTy->getNumElements(), VTy->getAltiVecSpecific());
+ VTy->getNumElements(), VTy->getVectorKind());
// For enums, we return the unsigned version of the base type.
if (const EnumType *ETy = T->getAs<EnumType>())
@@ -5422,7 +5422,7 @@ static QualType DecodeTypeFromStr(const char *&Str, ASTContext &Context,
// TODO: No way to make AltiVec vectors in builtins yet.
Type = Context.getVectorType(ElementType, NumElements,
- VectorType::NotAltiVec);
+ VectorType::GenericVector);
break;
}
case 'X': {