OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 7220ce4..8fd088a 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -200,7 +200,7 @@
Align = EltInfo.second;
break;
}
- case Type::OCUVector:
+ case Type::ExtVector:
case Type::Vector: {
std::pair<uint64_t, unsigned> EltInfo =
getTypeInfo(cast<VectorType>(T)->getElementType());
@@ -678,17 +678,17 @@
return QualType(New, 0);
}
-/// getOCUVectorType - Return the unique reference to an OCU vector type of
+/// getExtVectorType - Return the unique reference to an extended vector type of
/// the specified element type and size. VectorType must be a built-in type.
-QualType ASTContext::getOCUVectorType(QualType vecType, unsigned NumElts) {
+QualType ASTContext::getExtVectorType(QualType vecType, unsigned NumElts) {
BuiltinType *baseType;
baseType = dyn_cast<BuiltinType>(getCanonicalType(vecType).getTypePtr());
- assert(baseType != 0 && "getOCUVectorType(): Expecting a built-in type");
+ assert(baseType != 0 && "getExtVectorType(): Expecting a built-in type");
// Check if we've already instantiated a vector of this type.
llvm::FoldingSetNodeID ID;
- VectorType::Profile(ID, vecType, NumElts, Type::OCUVector);
+ VectorType::Profile(ID, vecType, NumElts, Type::ExtVector);
void *InsertPos = 0;
if (VectorType *VTP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos))
return QualType(VTP, 0);
@@ -697,13 +697,13 @@
// so fill in the canonical type field.
QualType Canonical;
if (!vecType->isCanonical()) {
- Canonical = getOCUVectorType(getCanonicalType(vecType), NumElts);
+ Canonical = getExtVectorType(getCanonicalType(vecType), NumElts);
// 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!");
}
- OCUVectorType *New = new OCUVectorType(vecType, NumElts, Canonical);
+ ExtVectorType *New = new ExtVectorType(vecType, NumElts, Canonical);
VectorTypes.InsertNode(New, InsertPos);
Types.push_back(New);
return QualType(New, 0);
@@ -1646,9 +1646,9 @@
if (RHSClass == Type::VariableArray || RHSClass == Type::IncompleteArray)
RHSClass = Type::ConstantArray;
- // Canonicalize OCUVector -> Vector.
- if (LHSClass == Type::OCUVector) LHSClass = Type::Vector;
- if (RHSClass == Type::OCUVector) RHSClass = Type::Vector;
+ // Canonicalize ExtVector -> Vector.
+ if (LHSClass == Type::ExtVector) LHSClass = Type::Vector;
+ if (RHSClass == Type::ExtVector) RHSClass = Type::Vector;
// Consider qualified interfaces and interfaces the same.
if (LHSClass == Type::ObjCQualifiedInterface) LHSClass = Type::ObjCInterface;
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 35bea75..264ef7b 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -396,8 +396,8 @@
return cast<ParenExpr>(this)->getSubExpr()->isLvalue();
case CompoundLiteralExprClass: // C99 6.5.2.5p5
return LV_Valid;
- case OCUVectorElementExprClass:
- if (cast<OCUVectorElementExpr>(this)->containsDuplicateElements())
+ case ExtVectorElementExprClass:
+ if (cast<ExtVectorElementExpr>(this)->containsDuplicateElements())
return LV_DuplicateVectorComponents;
return LV_Valid;
case ObjCIvarRefExprClass: // ObjC instance variables are lvalues.
@@ -1037,29 +1037,29 @@
return isIntegerConstantExpr(Val, Ctx, 0, true) && Val == 0;
}
-unsigned OCUVectorElementExpr::getNumElements() const {
+unsigned ExtVectorElementExpr::getNumElements() const {
return strlen(Accessor.getName());
}
/// getComponentType - Determine whether the components of this access are
/// "point" "color" or "texture" elements.
-OCUVectorElementExpr::ElementType
-OCUVectorElementExpr::getElementType() const {
+ExtVectorElementExpr::ElementType
+ExtVectorElementExpr::getElementType() const {
// derive the component type, no need to waste space.
const char *compStr = Accessor.getName();
- if (OCUVectorType::getPointAccessorIdx(*compStr) != -1) return Point;
- if (OCUVectorType::getColorAccessorIdx(*compStr) != -1) return Color;
+ if (ExtVectorType::getPointAccessorIdx(*compStr) != -1) return Point;
+ if (ExtVectorType::getColorAccessorIdx(*compStr) != -1) return Color;
- assert(OCUVectorType::getTextureAccessorIdx(*compStr) != -1 &&
+ assert(ExtVectorType::getTextureAccessorIdx(*compStr) != -1 &&
"getComponentType(): Illegal accessor");
return Texture;
}
/// containsDuplicateElements - Return true if any element access is
/// repeated.
-bool OCUVectorElementExpr::containsDuplicateElements() const {
+bool ExtVectorElementExpr::containsDuplicateElements() const {
const char *compStr = Accessor.getName();
unsigned length = strlen(compStr);
@@ -1073,7 +1073,7 @@
}
/// getEncodedElementAccess - We encode fields with two bits per component.
-unsigned OCUVectorElementExpr::getEncodedElementAccess() const {
+unsigned ExtVectorElementExpr::getEncodedElementAccess() const {
const char *compStr = Accessor.getName();
unsigned length = getNumElements();
@@ -1081,7 +1081,7 @@
while (length--) {
Result <<= 2;
- int Idx = OCUVectorType::getAccessorIdx(compStr[length]);
+ int Idx = ExtVectorType::getAccessorIdx(compStr[length]);
assert(Idx != -1 && "Invalid accessor letter");
Result |= Idx;
}
@@ -1268,11 +1268,11 @@
return reinterpret_cast<Stmt**>(&Base)+1;
}
-// OCUVectorElementExpr
-Stmt::child_iterator OCUVectorElementExpr::child_begin() {
+// ExtVectorElementExpr
+Stmt::child_iterator ExtVectorElementExpr::child_begin() {
return reinterpret_cast<Stmt**>(&Base);
}
-Stmt::child_iterator OCUVectorElementExpr::child_end() {
+Stmt::child_iterator ExtVectorElementExpr::child_end() {
return reinterpret_cast<Stmt**>(&Base)+1;
}
diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp
index 52eb91e..798ea84 100644
--- a/lib/AST/StmtDumper.cpp
+++ b/lib/AST/StmtDumper.cpp
@@ -124,7 +124,7 @@
void VisitUnaryOperator(UnaryOperator *Node);
void VisitSizeOfAlignOfTypeExpr(SizeOfAlignOfTypeExpr *Node);
void VisitMemberExpr(MemberExpr *Node);
- void VisitOCUVectorElementExpr(OCUVectorElementExpr *Node);
+ void VisitExtVectorElementExpr(ExtVectorElementExpr *Node);
void VisitBinaryOperator(BinaryOperator *Node);
void VisitCompoundAssignOperator(CompoundAssignOperator *Node);
void VisitAddrLabelExpr(AddrLabelExpr *Node);
@@ -377,7 +377,7 @@
fprintf(F, " %s%s %p", Node->isArrow() ? "->" : ".",
Node->getMemberDecl()->getName(), (void*)Node->getMemberDecl());
}
-void StmtDumper::VisitOCUVectorElementExpr(OCUVectorElementExpr *Node) {
+void StmtDumper::VisitExtVectorElementExpr(ExtVectorElementExpr *Node) {
DumpExpr(Node);
fprintf(F, " %s", Node->getAccessor().getName());
}
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index 2ff7f79..f838633 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -676,7 +676,7 @@
assert(Field && "MemberExpr should alway reference a field!");
OS << Field->getName();
}
-void StmtPrinter::VisitOCUVectorElementExpr(OCUVectorElementExpr *Node) {
+void StmtPrinter::VisitExtVectorElementExpr(ExtVectorElementExpr *Node) {
PrintExpr(Node->getBase());
OS << ".";
OS << Node->getAccessor().getName();
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 5040b95..741d59b 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -416,22 +416,22 @@
return getDesugaredType()->getAsVectorType();
}
-const OCUVectorType *Type::getAsOCUVectorType() const {
+const ExtVectorType *Type::getAsExtVectorType() const {
// Are we directly an OpenCU vector type?
- if (const OCUVectorType *VTy = dyn_cast<OCUVectorType>(this))
+ if (const ExtVectorType *VTy = dyn_cast<ExtVectorType>(this))
return VTy;
// If the canonical form of this type isn't the right kind, reject it.
- if (!isa<OCUVectorType>(CanonicalType)) {
+ if (!isa<ExtVectorType>(CanonicalType)) {
// Look through type qualifiers
- if (isa<OCUVectorType>(CanonicalType.getUnqualifiedType()))
- return CanonicalType.getUnqualifiedType()->getAsOCUVectorType();
+ if (isa<ExtVectorType>(CanonicalType.getUnqualifiedType()))
+ return CanonicalType.getUnqualifiedType()->getAsExtVectorType();
return 0;
}
- // If this is a typedef for an ocuvector type, strip the typedef off without
- // losing all typedef information.
- return getDesugaredType()->getAsOCUVectorType();
+ // If this is a typedef for an extended vector type, strip the typedef off
+ // without losing all typedef information.
+ return getDesugaredType()->getAsExtVectorType();
}
const ObjCInterfaceType *Type::getAsObjCInterfaceType() const {
@@ -903,8 +903,8 @@
ElementType.getAsStringInternal(S);
}
-void OCUVectorType::getAsStringInternal(std::string &S) const {
- S += " __attribute__((ocu_vector_type(";
+void ExtVectorType::getAsStringInternal(std::string &S) const {
+ S += " __attribute__((ext_vector_type(";
S += llvm::utostr_32(NumElements);
S += ")))";
ElementType.getAsStringInternal(S);