summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp20
-rw-r--r--clang/lib/AST/Expr.cpp28
-rw-r--r--clang/lib/AST/StmtDumper.cpp4
-rw-r--r--clang/lib/AST/StmtPrinter.cpp2
-rw-r--r--clang/lib/AST/Type.cpp20
5 files changed, 37 insertions, 37 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 7220ce4f9f0..8fd088a305f 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -200,7 +200,7 @@ ASTContext::getTypeInfo(QualType T) {
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 @@ QualType ASTContext::getVectorType(QualType vecType, unsigned NumElts) {
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 @@ QualType ASTContext::getOCUVectorType(QualType vecType, unsigned NumElts) {
// 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 @@ bool ASTContext::typesAreCompatible(QualType LHS_NC, QualType RHS_NC) {
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/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 35bea75045f..264ef7b0e8c 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -396,8 +396,8 @@ Expr::isLvalueResult Expr::isLvalue() const {
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 @@ bool Expr::isNullPointerConstant(ASTContext &Ctx) const {
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 @@ bool OCUVectorElementExpr::containsDuplicateElements() const {
}
/// 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 @@ unsigned OCUVectorElementExpr::getEncodedElementAccess() const {
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 @@ Stmt::child_iterator MemberExpr::child_end() {
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/clang/lib/AST/StmtDumper.cpp b/clang/lib/AST/StmtDumper.cpp
index 52eb91e4bf7..798ea84677e 100644
--- a/clang/lib/AST/StmtDumper.cpp
+++ b/clang/lib/AST/StmtDumper.cpp
@@ -124,7 +124,7 @@ namespace {
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 @@ void StmtDumper::VisitMemberExpr(MemberExpr *Node) {
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/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index 2ff7f79c2de..f838633171c 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -676,7 +676,7 @@ void StmtPrinter::VisitMemberExpr(MemberExpr *Node) {
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/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 5040b95e09c..741d59bc766 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -416,22 +416,22 @@ const VectorType *Type::getAsVectorType() const {
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 @@ void VectorType::getAsStringInternal(std::string &S) const {
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);
OpenPOWER on IntegriCloud