[cfe-commits] r45715 - in /cfe/trunk: AST/ CodeGen/ Driver/ Parse/ Sema/ include/clang/AST/ include/clang/Analysis/Visitors/ include/clang/Parse/
Ted Kremenek
kremenek at apple.com
Mon Jan 7 11:49:33 PST 2008
Author: kremenek
Date: Mon Jan 7 13:49:32 2008
New Revision: 45715
URL: http://llvm.org/viewvc/llvm-project?rev=45715&view=rev
Log:
Substituted all instances of the string "Objc" for "ObjC". This fixes
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.
Modified:
cfe/trunk/AST/ASTContext.cpp
cfe/trunk/AST/Decl.cpp
cfe/trunk/AST/DeclSerialization.cpp
cfe/trunk/AST/Expr.cpp
cfe/trunk/AST/Stmt.cpp
cfe/trunk/AST/StmtDumper.cpp
cfe/trunk/AST/StmtPrinter.cpp
cfe/trunk/AST/StmtSerialization.cpp
cfe/trunk/AST/Type.cpp
cfe/trunk/CodeGen/CGExprScalar.cpp
cfe/trunk/CodeGen/CodeGenTypes.cpp
cfe/trunk/Driver/ASTConsumers.cpp
cfe/trunk/Driver/RewriteTest.cpp
cfe/trunk/Parse/ParseObjc.cpp
cfe/trunk/Parse/ParseStmt.cpp
cfe/trunk/Parse/Parser.cpp
cfe/trunk/Sema/Sema.cpp
cfe/trunk/Sema/Sema.h
cfe/trunk/Sema/SemaChecking.cpp
cfe/trunk/Sema/SemaDecl.cpp
cfe/trunk/Sema/SemaDeclObjC.cpp
cfe/trunk/Sema/SemaExpr.cpp
cfe/trunk/Sema/SemaExprObjC.cpp
cfe/trunk/Sema/SemaStmt.cpp
cfe/trunk/Sema/SemaType.cpp
cfe/trunk/include/clang/AST/ASTContext.h
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/include/clang/AST/DeclObjC.h
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/include/clang/AST/StmtNodes.def
cfe/trunk/include/clang/AST/Type.h
cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h
cfe/trunk/include/clang/Parse/Action.h
cfe/trunk/include/clang/Parse/DeclSpec.h
cfe/trunk/include/clang/Parse/Parser.h
Modified: cfe/trunk/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/ASTContext.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/ASTContext.cpp (original)
+++ cfe/trunk/AST/ASTContext.cpp Mon Jan 7 13:49:32 2008
@@ -48,8 +48,8 @@
unsigned NumFunctionNP = 0, NumTypeName = 0, NumTagged = 0, NumReference = 0;
unsigned NumTagStruct = 0, NumTagUnion = 0, NumTagEnum = 0, NumTagClass = 0;
- unsigned NumObjcInterfaces = 0, NumObjcQualifiedInterfaces = 0;
- unsigned NumObjcQualifiedIds = 0;
+ unsigned NumObjCInterfaces = 0, NumObjCQualifiedInterfaces = 0;
+ unsigned NumObjCQualifiedIds = 0;
for (unsigned i = 0, e = Types.size(); i != e; ++i) {
Type *T = Types[i];
@@ -80,12 +80,12 @@
case Decl::Class: ++NumTagClass; break;
case Decl::Enum: ++NumTagEnum; break;
}
- } else if (isa<ObjcInterfaceType>(T))
- ++NumObjcInterfaces;
- else if (isa<ObjcQualifiedInterfaceType>(T))
- ++NumObjcQualifiedInterfaces;
- else if (isa<ObjcQualifiedIdType>(T))
- ++NumObjcQualifiedIds;
+ } else if (isa<ObjCInterfaceType>(T))
+ ++NumObjCInterfaces;
+ else if (isa<ObjCQualifiedInterfaceType>(T))
+ ++NumObjCQualifiedInterfaces;
+ else if (isa<ObjCQualifiedIdType>(T))
+ ++NumObjCQualifiedIds;
else {
QualType(T, 0).dump();
assert(0 && "Unknown type!");
@@ -106,11 +106,11 @@
fprintf(stderr, " %d union types\n", NumTagUnion);
fprintf(stderr, " %d class types\n", NumTagClass);
fprintf(stderr, " %d enum types\n", NumTagEnum);
- fprintf(stderr, " %d interface types\n", NumObjcInterfaces);
+ fprintf(stderr, " %d interface types\n", NumObjCInterfaces);
fprintf(stderr, " %d protocol qualified interface types\n",
- NumObjcQualifiedInterfaces);
+ NumObjCQualifiedInterfaces);
fprintf(stderr, " %d protocol qualified id types\n",
- NumObjcQualifiedIds);
+ NumObjCQualifiedIds);
fprintf(stderr, "Total bytes = %d\n", int(NumBuiltin*sizeof(BuiltinType)+
NumPointer*sizeof(PointerType)+NumArray*sizeof(ArrayType)+
NumComplex*sizeof(ComplexType)+NumVector*sizeof(VectorType)+
@@ -162,12 +162,12 @@
LongDoubleComplexTy = getComplexType(LongDoubleTy);
BuiltinVaListType = QualType();
- ObjcIdType = QualType();
+ ObjCIdType = QualType();
IdStructType = 0;
- ObjcClassType = QualType();
+ ObjCClassType = QualType();
ClassStructType = 0;
- ObjcConstantStringType = QualType();
+ ObjCConstantStringType = QualType();
// void * type
VoidPtrTy = getPointerType(VoidTy);
@@ -256,7 +256,7 @@
}
break;
}
- case Type::ObjcQualifiedId:
+ case Type::ObjCQualifiedId:
Target.getPointerInfo(Size, Align, getFullLoc(L));
break;
case Type::Pointer:
@@ -691,65 +691,65 @@
return QualType(Decl->TypeForDecl, 0);
}
-/// getObjcInterfaceType - Return the unique reference to the type for the
+/// getObjCInterfaceType - Return the unique reference to the type for the
/// specified ObjC interface decl.
-QualType ASTContext::getObjcInterfaceType(ObjcInterfaceDecl *Decl) {
+QualType ASTContext::getObjCInterfaceType(ObjCInterfaceDecl *Decl) {
if (Decl->TypeForDecl) return QualType(Decl->TypeForDecl, 0);
- Decl->TypeForDecl = new ObjcInterfaceType(Type::ObjcInterface, Decl);
+ Decl->TypeForDecl = new ObjCInterfaceType(Type::ObjCInterface, Decl);
Types.push_back(Decl->TypeForDecl);
return QualType(Decl->TypeForDecl, 0);
}
-/// getObjcQualifiedInterfaceType - Return a
-/// ObjcQualifiedInterfaceType type for the given interface decl and
+/// getObjCQualifiedInterfaceType - Return a
+/// ObjCQualifiedInterfaceType type for the given interface decl and
/// the conforming protocol list.
-QualType ASTContext::getObjcQualifiedInterfaceType(ObjcInterfaceDecl *Decl,
- ObjcProtocolDecl **Protocols, unsigned NumProtocols) {
+QualType ASTContext::getObjCQualifiedInterfaceType(ObjCInterfaceDecl *Decl,
+ ObjCProtocolDecl **Protocols, unsigned NumProtocols) {
llvm::FoldingSetNodeID ID;
- ObjcQualifiedInterfaceType::Profile(ID, Protocols, NumProtocols);
+ ObjCQualifiedInterfaceType::Profile(ID, Protocols, NumProtocols);
void *InsertPos = 0;
- if (ObjcQualifiedInterfaceType *QT =
- ObjcQualifiedInterfaceTypes.FindNodeOrInsertPos(ID, InsertPos))
+ if (ObjCQualifiedInterfaceType *QT =
+ ObjCQualifiedInterfaceTypes.FindNodeOrInsertPos(ID, InsertPos))
return QualType(QT, 0);
// No Match;
- ObjcQualifiedInterfaceType *QType =
- new ObjcQualifiedInterfaceType(Decl, Protocols, NumProtocols);
+ ObjCQualifiedInterfaceType *QType =
+ new ObjCQualifiedInterfaceType(Decl, Protocols, NumProtocols);
Types.push_back(QType);
- ObjcQualifiedInterfaceTypes.InsertNode(QType, InsertPos);
+ ObjCQualifiedInterfaceTypes.InsertNode(QType, InsertPos);
return QualType(QType, 0);
}
-/// getObjcQualifiedIdType - Return a
-/// getObjcQualifiedIdType type for the 'id' decl and
+/// getObjCQualifiedIdType - Return a
+/// getObjCQualifiedIdType type for the 'id' decl and
/// the conforming protocol list.
-QualType ASTContext::getObjcQualifiedIdType(QualType idType,
- ObjcProtocolDecl **Protocols,
+QualType ASTContext::getObjCQualifiedIdType(QualType idType,
+ ObjCProtocolDecl **Protocols,
unsigned NumProtocols) {
llvm::FoldingSetNodeID ID;
- ObjcQualifiedIdType::Profile(ID, Protocols, NumProtocols);
+ ObjCQualifiedIdType::Profile(ID, Protocols, NumProtocols);
void *InsertPos = 0;
- if (ObjcQualifiedIdType *QT =
- ObjcQualifiedIdTypes.FindNodeOrInsertPos(ID, InsertPos))
+ if (ObjCQualifiedIdType *QT =
+ ObjCQualifiedIdTypes.FindNodeOrInsertPos(ID, InsertPos))
return QualType(QT, 0);
// No Match;
QualType Canonical;
if (!idType->isCanonical()) {
- Canonical = getObjcQualifiedIdType(idType.getCanonicalType(),
+ Canonical = getObjCQualifiedIdType(idType.getCanonicalType(),
Protocols, NumProtocols);
- ObjcQualifiedIdType *NewQT =
- ObjcQualifiedIdTypes.FindNodeOrInsertPos(ID, InsertPos);
+ ObjCQualifiedIdType *NewQT =
+ ObjCQualifiedIdTypes.FindNodeOrInsertPos(ID, InsertPos);
assert(NewQT == 0 && "Shouldn't be in the map!");
}
- ObjcQualifiedIdType *QType =
- new ObjcQualifiedIdType(Canonical, Protocols, NumProtocols);
+ ObjCQualifiedIdType *QType =
+ new ObjCQualifiedIdType(Canonical, Protocols, NumProtocols);
Types.push_back(QType);
- ObjcQualifiedIdTypes.InsertNode(QType, InsertPos);
+ ObjCQualifiedIdTypes.InsertNode(QType, InsertPos);
return QualType(QType, 0);
}
@@ -961,9 +961,9 @@
return false;
}
-/// getObjcEncodingTypeSize returns size of type for objective-c encoding
+/// getObjCEncodingTypeSize returns size of type for objective-c encoding
/// purpose.
-int ASTContext::getObjcEncodingTypeSize(QualType type) {
+int ASTContext::getObjCEncodingTypeSize(QualType type) {
SourceLocation Loc;
uint64_t sz = getTypeSize(type, Loc);
@@ -976,15 +976,15 @@
return sz / getTypeSize(CharTy, Loc);
}
-/// getObjcEncodingForMethodDecl - Return the encoded type for this method
+/// getObjCEncodingForMethodDecl - Return the encoded type for this method
/// declaration.
-void ASTContext::getObjcEncodingForMethodDecl(ObjcMethodDecl *Decl,
+void ASTContext::getObjCEncodingForMethodDecl(ObjCMethodDecl *Decl,
std::string& S)
{
// Encode type qualifer, 'in', 'inout', etc. for the return type.
- getObjcEncodingForTypeQualifier(Decl->getObjcDeclQualifier(), S);
+ getObjCEncodingForTypeQualifier(Decl->getObjCDeclQualifier(), S);
// Encode result type.
- getObjcEncodingForType(Decl->getResultType(), S);
+ getObjCEncodingForType(Decl->getResultType(), S);
// Compute size of all parameters.
// Start with computing size of a pointer in number of bytes.
// FIXME: There might(should) be a better way of doing this computation!
@@ -996,8 +996,8 @@
int NumOfParams = Decl->getNumParams();
for (int i = 0; i < NumOfParams; i++) {
QualType PType = Decl->getParamDecl(i)->getType();
- int sz = getObjcEncodingTypeSize (PType);
- assert (sz > 0 && "getObjcEncodingForMethodDecl - Incomplete param type");
+ int sz = getObjCEncodingTypeSize (PType);
+ assert (sz > 0 && "getObjCEncodingForMethodDecl - Incomplete param type");
ParmOffset += sz;
}
S += llvm::utostr(ParmOffset);
@@ -1010,15 +1010,15 @@
QualType PType = Decl->getParamDecl(i)->getType();
// Process argument qualifiers for user supplied arguments; such as,
// 'in', 'inout', etc.
- getObjcEncodingForTypeQualifier(
- Decl->getParamDecl(i)->getObjcDeclQualifier(), S);
- getObjcEncodingForType(PType, S);
+ getObjCEncodingForTypeQualifier(
+ Decl->getParamDecl(i)->getObjCDeclQualifier(), S);
+ getObjCEncodingForType(PType, S);
S += llvm::utostr(ParmOffset);
- ParmOffset += getObjcEncodingTypeSize(PType);
+ ParmOffset += getObjCEncodingTypeSize(PType);
}
}
-void ASTContext::getObjcEncodingForType(QualType T, std::string& S) const
+void ASTContext::getObjCEncodingForType(QualType T, std::string& S) const
{
// FIXME: This currently doesn't encode:
// @ An object (whether statically typed or typed id)
@@ -1084,20 +1084,20 @@
S += encoding;
}
- else if (T->isObjcQualifiedIdType()) {
+ else if (T->isObjCQualifiedIdType()) {
// Treat id<P...> same as 'id' for encoding purposes.
- return getObjcEncodingForType(getObjcIdType(), S);
+ return getObjCEncodingForType(getObjCIdType(), S);
}
else if (const PointerType *PT = T->getAsPointerType()) {
QualType PointeeTy = PT->getPointeeType();
- if (isObjcIdType(PointeeTy) || PointeeTy->isObjcInterfaceType()) {
+ if (isObjCIdType(PointeeTy) || PointeeTy->isObjCInterfaceType()) {
S += '@';
return;
- } else if (isObjcClassType(PointeeTy)) {
+ } else if (isObjCClassType(PointeeTy)) {
S += '#';
return;
- } else if (isObjcSelType(PointeeTy)) {
+ } else if (isObjCSelType(PointeeTy)) {
S += ':';
return;
}
@@ -1112,7 +1112,7 @@
}
S += '^';
- getObjcEncodingForType(PT->getPointeeType(), S);
+ getObjCEncodingForType(PT->getPointeeType(), S);
} else if (const ArrayType *AT = T->getAsArrayType()) {
S += '[';
@@ -1121,7 +1121,7 @@
else
assert(0 && "Unhandled array type!");
- getObjcEncodingForType(AT->getElementType(), S);
+ getObjCEncodingForType(AT->getElementType(), S);
S += ']';
} else if (T->getAsFunctionType()) {
S += '?';
@@ -1132,7 +1132,7 @@
S += '=';
for (int i = 0; i < RDecl->getNumMembers(); i++) {
FieldDecl *field = RDecl->getMember(i);
- getObjcEncodingForType(field->getType(), S);
+ getObjCEncodingForType(field->getType(), S);
}
S += '}';
} else if (T->isEnumeralType()) {
@@ -1141,7 +1141,7 @@
assert(0 && "@encode for type not implemented!");
}
-void ASTContext::getObjcEncodingForTypeQualifier(Decl::ObjcDeclQualifier QT,
+void ASTContext::getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT,
std::string& S) const {
if (QT & Decl::OBJC_TQ_In)
S += 'n';
@@ -1164,11 +1164,11 @@
BuiltinVaListType = T;
}
-void ASTContext::setObjcIdType(TypedefDecl *TD)
+void ASTContext::setObjCIdType(TypedefDecl *TD)
{
- assert(ObjcIdType.isNull() && "'id' type already set!");
+ assert(ObjCIdType.isNull() && "'id' type already set!");
- ObjcIdType = getTypedefType(TD);
+ ObjCIdType = getTypedefType(TD);
// typedef struct objc_object *id;
const PointerType *ptr = TD->getUnderlyingType()->getAsPointerType();
@@ -1178,11 +1178,11 @@
IdStructType = rec;
}
-void ASTContext::setObjcSelType(TypedefDecl *TD)
+void ASTContext::setObjCSelType(TypedefDecl *TD)
{
- assert(ObjcSelType.isNull() && "'SEL' type already set!");
+ assert(ObjCSelType.isNull() && "'SEL' type already set!");
- ObjcSelType = getTypedefType(TD);
+ ObjCSelType = getTypedefType(TD);
// typedef struct objc_selector *SEL;
const PointerType *ptr = TD->getUnderlyingType()->getAsPointerType();
@@ -1192,17 +1192,17 @@
SelStructType = rec;
}
-void ASTContext::setObjcProtoType(QualType QT)
+void ASTContext::setObjCProtoType(QualType QT)
{
- assert(ObjcProtoType.isNull() && "'Protocol' type already set!");
- ObjcProtoType = QT;
+ assert(ObjCProtoType.isNull() && "'Protocol' type already set!");
+ ObjCProtoType = QT;
}
-void ASTContext::setObjcClassType(TypedefDecl *TD)
+void ASTContext::setObjCClassType(TypedefDecl *TD)
{
- assert(ObjcClassType.isNull() && "'Class' type already set!");
+ assert(ObjCClassType.isNull() && "'Class' type already set!");
- ObjcClassType = getTypedefType(TD);
+ ObjCClassType = getTypedefType(TD);
// typedef struct objc_class *Class;
const PointerType *ptr = TD->getUnderlyingType()->getAsPointerType();
@@ -1212,11 +1212,11 @@
ClassStructType = rec;
}
-void ASTContext::setObjcConstantStringInterface(ObjcInterfaceDecl *Decl) {
- assert(ObjcConstantStringType.isNull() &&
+void ASTContext::setObjCConstantStringInterface(ObjCInterfaceDecl *Decl) {
+ assert(ObjCConstantStringType.isNull() &&
"'NSConstantString' type already set!");
- ObjcConstantStringType = getObjcInterfaceType(Decl);
+ ObjCConstantStringType = getObjCInterfaceType(Decl);
}
bool ASTContext::builtinTypesAreCompatible(QualType lhs, QualType rhs) {
@@ -1231,20 +1231,20 @@
/// a qualified interface type and the other type is of a different class.
/// Example, II or II<P>.
bool ASTContext::objcTypesAreCompatible(QualType lhs, QualType rhs) {
- if (lhs->isObjcInterfaceType() && isObjcIdType(rhs))
+ if (lhs->isObjCInterfaceType() && isObjCIdType(rhs))
return true;
- else if (isObjcIdType(lhs) && rhs->isObjcInterfaceType())
+ else if (isObjCIdType(lhs) && rhs->isObjCInterfaceType())
return true;
- if (ObjcInterfaceType *lhsIT =
- dyn_cast<ObjcInterfaceType>(lhs.getCanonicalType().getTypePtr())) {
- ObjcQualifiedInterfaceType *rhsQI =
- dyn_cast<ObjcQualifiedInterfaceType>(rhs.getCanonicalType().getTypePtr());
+ if (ObjCInterfaceType *lhsIT =
+ dyn_cast<ObjCInterfaceType>(lhs.getCanonicalType().getTypePtr())) {
+ ObjCQualifiedInterfaceType *rhsQI =
+ dyn_cast<ObjCQualifiedInterfaceType>(rhs.getCanonicalType().getTypePtr());
return rhsQI && (lhsIT->getDecl() == rhsQI->getDecl());
}
- else if (ObjcInterfaceType *rhsIT =
- dyn_cast<ObjcInterfaceType>(rhs.getCanonicalType().getTypePtr())) {
- ObjcQualifiedInterfaceType *lhsQI =
- dyn_cast<ObjcQualifiedInterfaceType>(lhs.getCanonicalType().getTypePtr());
+ else if (ObjCInterfaceType *rhsIT =
+ dyn_cast<ObjCInterfaceType>(rhs.getCanonicalType().getTypePtr())) {
+ ObjCQualifiedInterfaceType *lhsQI =
+ dyn_cast<ObjCQualifiedInterfaceType>(lhs.getCanonicalType().getTypePtr());
return lhsQI && (rhsIT->getDecl() == lhsQI->getDecl());
}
return false;
@@ -1253,10 +1253,10 @@
bool ASTContext::interfaceTypesAreCompatible(QualType lhs, QualType rhs) {
if (lhs == rhs)
return true;
- ObjcInterfaceType *lhsIT = cast<ObjcInterfaceType>(lhs.getTypePtr());
- ObjcInterfaceType *rhsIT = cast<ObjcInterfaceType>(rhs.getTypePtr());
- ObjcInterfaceDecl *rhsIDecl = rhsIT->getDecl();
- ObjcInterfaceDecl *lhsIDecl = lhsIT->getDecl();
+ ObjCInterfaceType *lhsIT = cast<ObjCInterfaceType>(lhs.getTypePtr());
+ ObjCInterfaceType *rhsIT = cast<ObjCInterfaceType>(rhs.getTypePtr());
+ ObjCInterfaceDecl *rhsIDecl = rhsIT->getDecl();
+ ObjCInterfaceDecl *lhsIDecl = lhsIT->getDecl();
// rhs is derived from lhs it is OK; else it is not OK.
while (rhsIDecl != NULL) {
if (rhsIDecl == lhsIDecl)
@@ -1268,21 +1268,21 @@
bool ASTContext::QualifiedInterfaceTypesAreCompatible(QualType lhs,
QualType rhs) {
- ObjcQualifiedInterfaceType *lhsQI =
- dyn_cast<ObjcQualifiedInterfaceType>(lhs.getCanonicalType().getTypePtr());
+ ObjCQualifiedInterfaceType *lhsQI =
+ dyn_cast<ObjCQualifiedInterfaceType>(lhs.getCanonicalType().getTypePtr());
assert(lhsQI && "QualifiedInterfaceTypesAreCompatible - bad lhs type");
- ObjcQualifiedInterfaceType *rhsQI =
- dyn_cast<ObjcQualifiedInterfaceType>(rhs.getCanonicalType().getTypePtr());
+ ObjCQualifiedInterfaceType *rhsQI =
+ dyn_cast<ObjCQualifiedInterfaceType>(rhs.getCanonicalType().getTypePtr());
assert(rhsQI && "QualifiedInterfaceTypesAreCompatible - bad rhs type");
- if (!interfaceTypesAreCompatible(getObjcInterfaceType(lhsQI->getDecl()),
- getObjcInterfaceType(rhsQI->getDecl())))
+ if (!interfaceTypesAreCompatible(getObjCInterfaceType(lhsQI->getDecl()),
+ getObjCInterfaceType(rhsQI->getDecl())))
return false;
/* All protocols in lhs must have a presense in rhs. */
for (unsigned i =0; i < lhsQI->getNumProtocols(); i++) {
bool match = false;
- ObjcProtocolDecl *lhsProto = lhsQI->getProtocols(i);
+ ObjCProtocolDecl *lhsProto = lhsQI->getProtocols(i);
for (unsigned j = 0; j < rhsQI->getNumProtocols(); j++) {
- ObjcProtocolDecl *rhsProto = rhsQI->getProtocols(j);
+ ObjCProtocolDecl *rhsProto = rhsQI->getProtocols(j);
if (lhsProto == rhsProto) {
match = true;
break;
@@ -1296,11 +1296,11 @@
/// ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the
/// inheritance hierarchy of 'rProto'.
-static bool ProtocolCompatibleWithProtocol(ObjcProtocolDecl *lProto,
- ObjcProtocolDecl *rProto) {
+static bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto,
+ ObjCProtocolDecl *rProto) {
if (lProto == rProto)
return true;
- ObjcProtocolDecl** RefPDecl = rProto->getReferencedProtocols();
+ ObjCProtocolDecl** RefPDecl = rProto->getReferencedProtocols();
for (unsigned i = 0; i < rProto->getNumReferencedProtocols(); i++)
if (ProtocolCompatibleWithProtocol(lProto, RefPDecl[i]))
return true;
@@ -1310,12 +1310,12 @@
/// ClassImplementsProtocol - Checks that 'lProto' protocol
/// has been implemented in IDecl class, its super class or categories (if
/// lookupCategory is true).
-static bool ClassImplementsProtocol(ObjcProtocolDecl *lProto,
- ObjcInterfaceDecl *IDecl,
+static bool ClassImplementsProtocol(ObjCProtocolDecl *lProto,
+ ObjCInterfaceDecl *IDecl,
bool lookupCategory) {
// 1st, look up the class.
- ObjcProtocolDecl **protoList = IDecl->getReferencedProtocols();
+ ObjCProtocolDecl **protoList = IDecl->getReferencedProtocols();
for (unsigned i = 0; i < IDecl->getNumIntfRefProtocols(); i++) {
if (ProtocolCompatibleWithProtocol(lProto, protoList[i]))
return true;
@@ -1323,7 +1323,7 @@
// 2nd, look up the category.
if (lookupCategory)
- for (ObjcCategoryDecl *CDecl = IDecl->getCategoryList(); CDecl;
+ for (ObjCCategoryDecl *CDecl = IDecl->getCategoryList(); CDecl;
CDecl = CDecl->getNextClassCategory()) {
protoList = CDecl->getReferencedProtocols();
for (unsigned i = 0; i < CDecl->getNumReferencedProtocols(); i++) {
@@ -1340,42 +1340,42 @@
return false;
}
-/// ObjcQualifiedIdTypesAreCompatible - Compares two types, at least
+/// ObjCQualifiedIdTypesAreCompatible - Compares two types, at least
/// one of which is a protocol qualified 'id' type. When 'compare'
/// is true it is for comparison; when false, for assignment/initialization.
-bool ASTContext::ObjcQualifiedIdTypesAreCompatible(QualType lhs,
+bool ASTContext::ObjCQualifiedIdTypesAreCompatible(QualType lhs,
QualType rhs,
bool compare) {
// match id<P..> with an 'id' type in all cases.
if (const PointerType *PT = lhs->getAsPointerType()) {
QualType PointeeTy = PT->getPointeeType();
- if (isObjcIdType(PointeeTy) || PointeeTy->isVoidType())
+ if (isObjCIdType(PointeeTy) || PointeeTy->isVoidType())
return true;
}
else if (const PointerType *PT = rhs->getAsPointerType()) {
QualType PointeeTy = PT->getPointeeType();
- if (isObjcIdType(PointeeTy) || PointeeTy->isVoidType())
+ if (isObjCIdType(PointeeTy) || PointeeTy->isVoidType())
return true;
}
- ObjcQualifiedInterfaceType *lhsQI = 0;
- ObjcQualifiedInterfaceType *rhsQI = 0;
- ObjcInterfaceDecl *lhsID = 0;
- ObjcInterfaceDecl *rhsID = 0;
- ObjcQualifiedIdType *lhsQID = dyn_cast<ObjcQualifiedIdType>(lhs);
- ObjcQualifiedIdType *rhsQID = dyn_cast<ObjcQualifiedIdType>(rhs);
+ ObjCQualifiedInterfaceType *lhsQI = 0;
+ ObjCQualifiedInterfaceType *rhsQI = 0;
+ ObjCInterfaceDecl *lhsID = 0;
+ ObjCInterfaceDecl *rhsID = 0;
+ ObjCQualifiedIdType *lhsQID = dyn_cast<ObjCQualifiedIdType>(lhs);
+ ObjCQualifiedIdType *rhsQID = dyn_cast<ObjCQualifiedIdType>(rhs);
if (lhsQID) {
if (!rhsQID && rhs->getTypeClass() == Type::Pointer) {
QualType rtype =
cast<PointerType>(rhs.getCanonicalType())->getPointeeType();
rhsQI =
- dyn_cast<ObjcQualifiedInterfaceType>(
+ dyn_cast<ObjCQualifiedInterfaceType>(
rtype.getCanonicalType().getTypePtr());
if (!rhsQI) {
- ObjcInterfaceType *IT = dyn_cast<ObjcInterfaceType>(
+ ObjCInterfaceType *IT = dyn_cast<ObjCInterfaceType>(
rtype.getCanonicalType().getTypePtr());
if (IT)
rhsID = IT->getDecl();
@@ -1385,7 +1385,7 @@
return false;
unsigned numRhsProtocols = 0;
- ObjcProtocolDecl **rhsProtoList = 0;
+ ObjCProtocolDecl **rhsProtoList = 0;
if (rhsQI) {
numRhsProtocols = rhsQI->getNumProtocols();
rhsProtoList = rhsQI->getReferencedProtocols();
@@ -1396,7 +1396,7 @@
}
for (unsigned i =0; i < lhsQID->getNumProtocols(); i++) {
- ObjcProtocolDecl *lhsProto = lhsQID->getProtocols(i);
+ ObjCProtocolDecl *lhsProto = lhsQID->getProtocols(i);
bool match = false;
// when comparing an id<P> on lhs with a static type on rhs,
@@ -1407,7 +1407,7 @@
match = true;
}
else for (unsigned j = 0; j < numRhsProtocols; j++) {
- ObjcProtocolDecl *rhsProto = rhsProtoList[j];
+ ObjCProtocolDecl *rhsProto = rhsProtoList[j];
if (ProtocolCompatibleWithProtocol(lhsProto, rhsProto) ||
compare && ProtocolCompatibleWithProtocol(rhsProto, lhsProto)) {
match = true;
@@ -1423,10 +1423,10 @@
QualType ltype =
cast<PointerType>(lhs.getCanonicalType())->getPointeeType();
lhsQI =
- dyn_cast<ObjcQualifiedInterfaceType>(
+ dyn_cast<ObjCQualifiedInterfaceType>(
ltype.getCanonicalType().getTypePtr());
if (!lhsQI) {
- ObjcInterfaceType *IT = dyn_cast<ObjcInterfaceType>(
+ ObjCInterfaceType *IT = dyn_cast<ObjCInterfaceType>(
ltype.getCanonicalType().getTypePtr());
if (IT)
lhsID = IT->getDecl();
@@ -1436,7 +1436,7 @@
return false;
unsigned numLhsProtocols = 0;
- ObjcProtocolDecl **lhsProtoList = 0;
+ ObjCProtocolDecl **lhsProtoList = 0;
if (lhsQI) {
numLhsProtocols = lhsQI->getNumProtocols();
lhsProtoList = lhsQI->getReferencedProtocols();
@@ -1450,7 +1450,7 @@
// one of 'id's protocols.
if (lhsID) {
for (unsigned j = 0; j < rhsQID->getNumProtocols(); j++) {
- ObjcProtocolDecl *rhsProto = rhsQID->getProtocols(j);
+ ObjCProtocolDecl *rhsProto = rhsQID->getProtocols(j);
if (ClassImplementsProtocol(rhsProto, lhsID, compare)) {
match = true;
break;
@@ -1459,9 +1459,9 @@
}
else for (unsigned i =0; i < numLhsProtocols; i++) {
match = false;
- ObjcProtocolDecl *lhsProto = lhsProtoList[i];
+ ObjCProtocolDecl *lhsProto = lhsProtoList[i];
for (unsigned j = 0; j < rhsQID->getNumProtocols(); j++) {
- ObjcProtocolDecl *rhsProto = rhsQID->getProtocols(j);
+ ObjCProtocolDecl *rhsProto = rhsQID->getProtocols(j);
if (ProtocolCompatibleWithProtocol(lhsProto, rhsProto) ||
compare && ProtocolCompatibleWithProtocol(rhsProto, lhsProto)) {
match = true;
@@ -1501,8 +1501,8 @@
return true;
}
// "Class" and "id" are compatible built-in structure types.
- if (isObjcIdType(lhs) && isObjcClassType(rhs) ||
- isObjcClassType(lhs) && isObjcIdType(rhs))
+ if (isObjCIdType(lhs) && isObjCClassType(rhs) ||
+ isObjCClassType(lhs) && isObjCIdType(rhs))
return true;
return false;
}
@@ -1616,7 +1616,7 @@
// For Objective-C, it is possible for two types to be compatible
// when their classes don't match (when dealing with "id"). If either type
// is an interface, we defer to objcTypesAreCompatible().
- if (lcanon->isObjcInterfaceType() || rcanon->isObjcInterfaceType())
+ if (lcanon->isObjCInterfaceType() || rcanon->isObjCInterfaceType())
return objcTypesAreCompatible(lcanon, rcanon);
return false;
}
@@ -1633,12 +1633,12 @@
return tagTypesAreCompatible(lcanon, rcanon);
case Type::Builtin:
return builtinTypesAreCompatible(lcanon, rcanon);
- case Type::ObjcInterface:
+ case Type::ObjCInterface:
return interfaceTypesAreCompatible(lcanon, rcanon);
case Type::Vector:
case Type::OCUVector:
return vectorTypesAreCompatible(lcanon, rcanon);
- case Type::ObjcQualifiedInterface:
+ case Type::ObjCQualifiedInterface:
return QualifiedInterfaceTypesAreCompatible(lcanon, rcanon);
default:
assert(0 && "unexpected type");
Modified: cfe/trunk/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Decl.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/Decl.cpp (original)
+++ cfe/trunk/AST/Decl.cpp Mon Jan 7 13:49:32 2008
@@ -33,10 +33,10 @@
static unsigned nForwardProtocolDecls = 0;
static unsigned nCategoryDecls = 0;
static unsigned nIvarDecls = 0;
-static unsigned nObjcImplementationDecls = 0;
-static unsigned nObjcCategoryImpl = 0;
-static unsigned nObjcCompatibleAlias = 0;
-static unsigned nObjcPropertyDecl = 0;
+static unsigned nObjCImplementationDecls = 0;
+static unsigned nObjCCategoryImpl = 0;
+static unsigned nObjCCompatibleAlias = 0;
+static unsigned nObjCPropertyDecl = 0;
static bool StatSwitch = false;
@@ -55,16 +55,16 @@
return "ParmVar";
case EnumConstant:
return "EnumConstant";
- case ObjcInterface:
- return "ObjcInterface";
- case ObjcClass:
- return "ObjcClass";
- case ObjcMethod:
- return "ObjcMethod";
- case ObjcProtocol:
- return "ObjcProtocol";
- case ObjcForwardProtocol:
- return "ObjcForwardProtocol";
+ case ObjCInterface:
+ return "ObjCInterface";
+ case ObjCClass:
+ return "ObjCClass";
+ case ObjCMethod:
+ return "ObjCMethod";
+ case ObjCProtocol:
+ return "ObjCProtocol";
+ case ObjCForwardProtocol:
+ return "ObjCForwardProtocol";
case Struct:
return "Struct";
case Union:
@@ -114,49 +114,49 @@
nTypedef, (int)sizeof(TypedefDecl),int(nTypedef*sizeof(TypedefDecl)));
// Objective-C decls...
fprintf(stderr, " %d interface decls, %d each (%d bytes)\n",
- nInterfaceDecls, (int)sizeof(ObjcInterfaceDecl),
- int(nInterfaceDecls*sizeof(ObjcInterfaceDecl)));
+ nInterfaceDecls, (int)sizeof(ObjCInterfaceDecl),
+ int(nInterfaceDecls*sizeof(ObjCInterfaceDecl)));
fprintf(stderr, " %d instance variable decls, %d each (%d bytes)\n",
- nIvarDecls, (int)sizeof(ObjcIvarDecl),
- int(nIvarDecls*sizeof(ObjcIvarDecl)));
+ nIvarDecls, (int)sizeof(ObjCIvarDecl),
+ int(nIvarDecls*sizeof(ObjCIvarDecl)));
fprintf(stderr, " %d class decls, %d each (%d bytes)\n",
- nClassDecls, (int)sizeof(ObjcClassDecl),
- int(nClassDecls*sizeof(ObjcClassDecl)));
+ nClassDecls, (int)sizeof(ObjCClassDecl),
+ int(nClassDecls*sizeof(ObjCClassDecl)));
fprintf(stderr, " %d method decls, %d each (%d bytes)\n",
- nMethodDecls, (int)sizeof(ObjcMethodDecl),
- int(nMethodDecls*sizeof(ObjcMethodDecl)));
+ nMethodDecls, (int)sizeof(ObjCMethodDecl),
+ int(nMethodDecls*sizeof(ObjCMethodDecl)));
fprintf(stderr, " %d protocol decls, %d each (%d bytes)\n",
- nProtocolDecls, (int)sizeof(ObjcProtocolDecl),
- int(nProtocolDecls*sizeof(ObjcProtocolDecl)));
+ nProtocolDecls, (int)sizeof(ObjCProtocolDecl),
+ int(nProtocolDecls*sizeof(ObjCProtocolDecl)));
fprintf(stderr, " %d forward protocol decls, %d each (%d bytes)\n",
- nForwardProtocolDecls, (int)sizeof(ObjcForwardProtocolDecl),
- int(nForwardProtocolDecls*sizeof(ObjcForwardProtocolDecl)));
+ nForwardProtocolDecls, (int)sizeof(ObjCForwardProtocolDecl),
+ int(nForwardProtocolDecls*sizeof(ObjCForwardProtocolDecl)));
fprintf(stderr, " %d category decls, %d each (%d bytes)\n",
- nCategoryDecls, (int)sizeof(ObjcCategoryDecl),
- int(nCategoryDecls*sizeof(ObjcCategoryDecl)));
+ nCategoryDecls, (int)sizeof(ObjCCategoryDecl),
+ int(nCategoryDecls*sizeof(ObjCCategoryDecl)));
fprintf(stderr, " %d class implementation decls, %d each (%d bytes)\n",
- nObjcImplementationDecls, (int)sizeof(ObjcImplementationDecl),
- int(nObjcImplementationDecls*sizeof(ObjcImplementationDecl)));
+ nObjCImplementationDecls, (int)sizeof(ObjCImplementationDecl),
+ int(nObjCImplementationDecls*sizeof(ObjCImplementationDecl)));
fprintf(stderr, " %d class implementation decls, %d each (%d bytes)\n",
- nObjcCategoryImpl, (int)sizeof(ObjcCategoryImplDecl),
- int(nObjcCategoryImpl*sizeof(ObjcCategoryImplDecl)));
+ nObjCCategoryImpl, (int)sizeof(ObjCCategoryImplDecl),
+ int(nObjCCategoryImpl*sizeof(ObjCCategoryImplDecl)));
fprintf(stderr, " %d compatibility alias decls, %d each (%d bytes)\n",
- nObjcCompatibleAlias, (int)sizeof(ObjcCompatibleAliasDecl),
- int(nObjcCompatibleAlias*sizeof(ObjcCompatibleAliasDecl)));
+ nObjCCompatibleAlias, (int)sizeof(ObjCCompatibleAliasDecl),
+ int(nObjCCompatibleAlias*sizeof(ObjCCompatibleAliasDecl)));
fprintf(stderr, " %d property decls, %d each (%d bytes)\n",
- nObjcPropertyDecl, (int)sizeof(ObjcPropertyDecl),
- int(nObjcPropertyDecl*sizeof(ObjcPropertyDecl)));
+ nObjCPropertyDecl, (int)sizeof(ObjCPropertyDecl),
+ int(nObjCPropertyDecl*sizeof(ObjCPropertyDecl)));
fprintf(stderr, "Total bytes = %d\n",
int(nFuncs*sizeof(FunctionDecl)+nBlockVars*sizeof(BlockVarDecl)+
nFileVars*sizeof(FileVarDecl)+nParmVars*sizeof(ParmVarDecl)+
nFieldDecls*sizeof(FieldDecl)+nSUC*sizeof(RecordDecl)+
nEnumDecls*sizeof(EnumDecl)+nEnumConst*sizeof(EnumConstantDecl)+
- nTypedef*sizeof(TypedefDecl)) /* FIXME: add Objc decls */);
+ nTypedef*sizeof(TypedefDecl)) /* FIXME: add ObjC decls */);
}
void Decl::addDeclKind(const Kind k) {
@@ -190,38 +190,38 @@
case Enum:
nEnumDecls++;
break;
- case ObjcInterface:
+ case ObjCInterface:
nInterfaceDecls++;
break;
- case ObjcClass:
+ case ObjCClass:
nClassDecls++;
break;
- case ObjcMethod:
+ case ObjCMethod:
nMethodDecls++;
break;
- case ObjcProtocol:
+ case ObjCProtocol:
nProtocolDecls++;
break;
- case ObjcForwardProtocol:
+ case ObjCForwardProtocol:
nForwardProtocolDecls++;
break;
- case ObjcCategory:
+ case ObjCCategory:
nCategoryDecls++;
break;
- case ObjcIvar:
+ case ObjCIvar:
nIvarDecls++;
break;
- case ObjcImplementation:
- nObjcImplementationDecls++;
+ case ObjCImplementation:
+ nObjCImplementationDecls++;
break;
- case ObjcCategoryImpl:
- nObjcCategoryImpl++;
+ case ObjCCategoryImpl:
+ nObjCCategoryImpl++;
break;
case CompatibleAlias:
- nObjcCompatibleAlias++;
+ nObjCCompatibleAlias++;
break;
case PropertyDecl:
- nObjcPropertyDecl++;
+ nObjCPropertyDecl++;
break;
}
}
@@ -283,7 +283,7 @@
return 0;
}
-void ObjcMethodDecl::setMethodParams(ParmVarDecl **NewParamInfo,
+void ObjCMethodDecl::setMethodParams(ParmVarDecl **NewParamInfo,
unsigned NumParams) {
assert(ParamInfo == 0 && "Already has param info!");
@@ -295,103 +295,103 @@
}
}
-ObjcMethodDecl::~ObjcMethodDecl() {
+ObjCMethodDecl::~ObjCMethodDecl() {
delete[] ParamInfo;
}
-/// ObjcAddInstanceVariablesToClass - Inserts instance variables
-/// into ObjcInterfaceDecl's fields.
+/// ObjCAddInstanceVariablesToClass - Inserts instance variables
+/// into ObjCInterfaceDecl's fields.
///
-void ObjcInterfaceDecl::addInstanceVariablesToClass(ObjcIvarDecl **ivars,
+void ObjCInterfaceDecl::addInstanceVariablesToClass(ObjCIvarDecl **ivars,
unsigned numIvars,
SourceLocation RBrac) {
NumIvars = numIvars;
if (numIvars) {
- Ivars = new ObjcIvarDecl*[numIvars];
- memcpy(Ivars, ivars, numIvars*sizeof(ObjcIvarDecl*));
+ Ivars = new ObjCIvarDecl*[numIvars];
+ memcpy(Ivars, ivars, numIvars*sizeof(ObjCIvarDecl*));
}
setLocEnd(RBrac);
}
-/// ObjcAddInstanceVariablesToClassImpl - Checks for correctness of Instance
+/// ObjCAddInstanceVariablesToClassImpl - Checks for correctness of Instance
/// Variables (Ivars) relative to what declared in @implementation;s class.
-/// Ivars into ObjcImplementationDecl's fields.
+/// Ivars into ObjCImplementationDecl's fields.
///
-void ObjcImplementationDecl::ObjcAddInstanceVariablesToClassImpl(
- ObjcIvarDecl **ivars, unsigned numIvars) {
+void ObjCImplementationDecl::ObjCAddInstanceVariablesToClassImpl(
+ ObjCIvarDecl **ivars, unsigned numIvars) {
NumIvars = numIvars;
if (numIvars) {
- Ivars = new ObjcIvarDecl*[numIvars];
- memcpy(Ivars, ivars, numIvars*sizeof(ObjcIvarDecl*));
+ Ivars = new ObjCIvarDecl*[numIvars];
+ memcpy(Ivars, ivars, numIvars*sizeof(ObjCIvarDecl*));
}
}
/// addMethods - Insert instance and methods declarations into
-/// ObjcInterfaceDecl's InsMethods and ClsMethods fields.
+/// ObjCInterfaceDecl's InsMethods and ClsMethods fields.
///
-void ObjcInterfaceDecl::addMethods(ObjcMethodDecl **insMethods,
+void ObjCInterfaceDecl::addMethods(ObjCMethodDecl **insMethods,
unsigned numInsMembers,
- ObjcMethodDecl **clsMethods,
+ ObjCMethodDecl **clsMethods,
unsigned numClsMembers,
SourceLocation endLoc) {
NumInstanceMethods = numInsMembers;
if (numInsMembers) {
- InstanceMethods = new ObjcMethodDecl*[numInsMembers];
- memcpy(InstanceMethods, insMethods, numInsMembers*sizeof(ObjcMethodDecl*));
+ InstanceMethods = new ObjCMethodDecl*[numInsMembers];
+ memcpy(InstanceMethods, insMethods, numInsMembers*sizeof(ObjCMethodDecl*));
}
NumClassMethods = numClsMembers;
if (numClsMembers) {
- ClassMethods = new ObjcMethodDecl*[numClsMembers];
- memcpy(ClassMethods, clsMethods, numClsMembers*sizeof(ObjcMethodDecl*));
+ ClassMethods = new ObjCMethodDecl*[numClsMembers];
+ memcpy(ClassMethods, clsMethods, numClsMembers*sizeof(ObjCMethodDecl*));
}
AtEndLoc = endLoc;
}
/// addMethods - Insert instance and methods declarations into
-/// ObjcProtocolDecl's ProtoInsMethods and ProtoClsMethods fields.
+/// ObjCProtocolDecl's ProtoInsMethods and ProtoClsMethods fields.
///
-void ObjcProtocolDecl::addMethods(ObjcMethodDecl **insMethods,
+void ObjCProtocolDecl::addMethods(ObjCMethodDecl **insMethods,
unsigned numInsMembers,
- ObjcMethodDecl **clsMethods,
+ ObjCMethodDecl **clsMethods,
unsigned numClsMembers,
SourceLocation endLoc) {
NumInstanceMethods = numInsMembers;
if (numInsMembers) {
- InstanceMethods = new ObjcMethodDecl*[numInsMembers];
- memcpy(InstanceMethods, insMethods, numInsMembers*sizeof(ObjcMethodDecl*));
+ InstanceMethods = new ObjCMethodDecl*[numInsMembers];
+ memcpy(InstanceMethods, insMethods, numInsMembers*sizeof(ObjCMethodDecl*));
}
NumClassMethods = numClsMembers;
if (numClsMembers) {
- ClassMethods = new ObjcMethodDecl*[numClsMembers];
- memcpy(ClassMethods, clsMethods, numClsMembers*sizeof(ObjcMethodDecl*));
+ ClassMethods = new ObjCMethodDecl*[numClsMembers];
+ memcpy(ClassMethods, clsMethods, numClsMembers*sizeof(ObjCMethodDecl*));
}
AtEndLoc = endLoc;
}
/// addMethods - Insert instance and methods declarations into
-/// ObjcCategoryDecl's CatInsMethods and CatClsMethods fields.
+/// ObjCCategoryDecl's CatInsMethods and CatClsMethods fields.
///
-void ObjcCategoryDecl::addMethods(ObjcMethodDecl **insMethods,
+void ObjCCategoryDecl::addMethods(ObjCMethodDecl **insMethods,
unsigned numInsMembers,
- ObjcMethodDecl **clsMethods,
+ ObjCMethodDecl **clsMethods,
unsigned numClsMembers,
SourceLocation endLoc) {
NumInstanceMethods = numInsMembers;
if (numInsMembers) {
- InstanceMethods = new ObjcMethodDecl*[numInsMembers];
- memcpy(InstanceMethods, insMethods, numInsMembers*sizeof(ObjcMethodDecl*));
+ InstanceMethods = new ObjCMethodDecl*[numInsMembers];
+ memcpy(InstanceMethods, insMethods, numInsMembers*sizeof(ObjCMethodDecl*));
}
NumClassMethods = numClsMembers;
if (numClsMembers) {
- ClassMethods = new ObjcMethodDecl*[numClsMembers];
- memcpy(ClassMethods, clsMethods, numClsMembers*sizeof(ObjcMethodDecl*));
+ ClassMethods = new ObjCMethodDecl*[numClsMembers];
+ memcpy(ClassMethods, clsMethods, numClsMembers*sizeof(ObjCMethodDecl*));
}
AtEndLoc = endLoc;
}
-ObjcIvarDecl *ObjcInterfaceDecl::lookupInstanceVariable(
- IdentifierInfo *ID, ObjcInterfaceDecl *&clsDeclared) {
- ObjcInterfaceDecl* ClassDecl = this;
+ObjCIvarDecl *ObjCInterfaceDecl::lookupInstanceVariable(
+ IdentifierInfo *ID, ObjCInterfaceDecl *&clsDeclared) {
+ ObjCInterfaceDecl* ClassDecl = this;
while (ClassDecl != NULL) {
for (ivar_iterator I = ClassDecl->ivar_begin(), E = ClassDecl->ivar_end();
I != E; ++I) {
@@ -407,23 +407,23 @@
/// lookupInstanceMethod - This method returns an instance method by looking in
/// the class, its categories, and its super classes (using a linear search).
-ObjcMethodDecl *ObjcInterfaceDecl::lookupInstanceMethod(Selector Sel) {
- ObjcInterfaceDecl* ClassDecl = this;
- ObjcMethodDecl *MethodDecl = 0;
+ObjCMethodDecl *ObjCInterfaceDecl::lookupInstanceMethod(Selector Sel) {
+ ObjCInterfaceDecl* ClassDecl = this;
+ ObjCMethodDecl *MethodDecl = 0;
while (ClassDecl != NULL) {
if ((MethodDecl = ClassDecl->getInstanceMethod(Sel)))
return MethodDecl;
// Didn't find one yet - look through protocols.
- ObjcProtocolDecl **protocols = ClassDecl->getReferencedProtocols();
+ ObjCProtocolDecl **protocols = ClassDecl->getReferencedProtocols();
int numProtocols = ClassDecl->getNumIntfRefProtocols();
for (int pIdx = 0; pIdx < numProtocols; pIdx++) {
if ((MethodDecl = protocols[pIdx]->getInstanceMethod(Sel)))
return MethodDecl;
}
// Didn't find one yet - now look through categories.
- ObjcCategoryDecl *CatDecl = ClassDecl->getCategoryList();
+ ObjCCategoryDecl *CatDecl = ClassDecl->getCategoryList();
while (CatDecl) {
if ((MethodDecl = CatDecl->getInstanceMethod(Sel)))
return MethodDecl;
@@ -436,23 +436,23 @@
// lookupClassMethod - This method returns a class method by looking in the
// class, its categories, and its super classes (using a linear search).
-ObjcMethodDecl *ObjcInterfaceDecl::lookupClassMethod(Selector Sel) {
- ObjcInterfaceDecl* ClassDecl = this;
- ObjcMethodDecl *MethodDecl = 0;
+ObjCMethodDecl *ObjCInterfaceDecl::lookupClassMethod(Selector Sel) {
+ ObjCInterfaceDecl* ClassDecl = this;
+ ObjCMethodDecl *MethodDecl = 0;
while (ClassDecl != NULL) {
if ((MethodDecl = ClassDecl->getClassMethod(Sel)))
return MethodDecl;
// Didn't find one yet - look through protocols.
- ObjcProtocolDecl **protocols = ClassDecl->getReferencedProtocols();
+ ObjCProtocolDecl **protocols = ClassDecl->getReferencedProtocols();
int numProtocols = ClassDecl->getNumIntfRefProtocols();
for (int pIdx = 0; pIdx < numProtocols; pIdx++) {
if ((MethodDecl = protocols[pIdx]->getClassMethod(Sel)))
return MethodDecl;
}
// Didn't find one yet - now look through categories.
- ObjcCategoryDecl *CatDecl = ClassDecl->getCategoryList();
+ ObjCCategoryDecl *CatDecl = ClassDecl->getCategoryList();
while (CatDecl) {
if ((MethodDecl = CatDecl->getClassMethod(Sel)))
return MethodDecl;
@@ -466,7 +466,7 @@
/// lookupInstanceMethod - This method returns an instance method by looking in
/// the class implementation. Unlike interfaces, we don't look outside the
/// implementation.
-ObjcMethodDecl *ObjcImplementationDecl::getInstanceMethod(Selector Sel) {
+ObjCMethodDecl *ObjCImplementationDecl::getInstanceMethod(Selector Sel) {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); I != E; ++I)
if ((*I)->getSelector() == Sel)
return *I;
@@ -476,7 +476,7 @@
/// lookupClassMethod - This method returns a class method by looking in
/// the class implementation. Unlike interfaces, we don't look outside the
/// implementation.
-ObjcMethodDecl *ObjcImplementationDecl::getClassMethod(Selector Sel) {
+ObjCMethodDecl *ObjCImplementationDecl::getClassMethod(Selector Sel) {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I)
if ((*I)->getSelector() == Sel)
@@ -487,7 +487,7 @@
// lookupInstanceMethod - This method returns an instance method by looking in
// the class implementation. Unlike interfaces, we don't look outside the
// implementation.
-ObjcMethodDecl *ObjcCategoryImplDecl::getInstanceMethod(Selector Sel) {
+ObjCMethodDecl *ObjCCategoryImplDecl::getInstanceMethod(Selector Sel) {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end(); I != E; ++I)
if ((*I)->getSelector() == Sel)
return *I;
@@ -497,7 +497,7 @@
// lookupClassMethod - This method returns an instance method by looking in
// the class implementation. Unlike interfaces, we don't look outside the
// implementation.
-ObjcMethodDecl *ObjcCategoryImplDecl::getClassMethod(Selector Sel) {
+ObjCMethodDecl *ObjCCategoryImplDecl::getClassMethod(Selector Sel) {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I)
if ((*I)->getSelector() == Sel)
@@ -507,14 +507,14 @@
// lookupInstanceMethod - Lookup a instance method in the protocol and protocols
// it inherited.
-ObjcMethodDecl *ObjcProtocolDecl::lookupInstanceMethod(Selector Sel) {
- ObjcMethodDecl *MethodDecl = NULL;
+ObjCMethodDecl *ObjCProtocolDecl::lookupInstanceMethod(Selector Sel) {
+ ObjCMethodDecl *MethodDecl = NULL;
if ((MethodDecl = getInstanceMethod(Sel)))
return MethodDecl;
if (getNumReferencedProtocols() > 0) {
- ObjcProtocolDecl **RefPDecl = getReferencedProtocols();
+ ObjCProtocolDecl **RefPDecl = getReferencedProtocols();
for (unsigned i = 0; i < getNumReferencedProtocols(); i++) {
if ((MethodDecl = RefPDecl[i]->getInstanceMethod(Sel)))
@@ -526,14 +526,14 @@
// lookupInstanceMethod - Lookup a class method in the protocol and protocols
// it inherited.
-ObjcMethodDecl *ObjcProtocolDecl::lookupClassMethod(Selector Sel) {
- ObjcMethodDecl *MethodDecl = NULL;
+ObjCMethodDecl *ObjCProtocolDecl::lookupClassMethod(Selector Sel) {
+ ObjCMethodDecl *MethodDecl = NULL;
if ((MethodDecl = getClassMethod(Sel)))
return MethodDecl;
if (getNumReferencedProtocols() > 0) {
- ObjcProtocolDecl **RefPDecl = getReferencedProtocols();
+ ObjCProtocolDecl **RefPDecl = getReferencedProtocols();
for(unsigned i = 0; i < getNumReferencedProtocols(); i++) {
if ((MethodDecl = RefPDecl[i]->getClassMethod(Sel)))
@@ -543,16 +543,16 @@
return NULL;
}
-ObjcInterfaceDecl *const ObjcMethodDecl::getClassInterface() const {
- if (ObjcInterfaceDecl *ID = dyn_cast<ObjcInterfaceDecl>(MethodContext))
+ObjCInterfaceDecl *const ObjCMethodDecl::getClassInterface() const {
+ if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(MethodContext))
return ID;
- if (ObjcCategoryDecl *CD = dyn_cast<ObjcCategoryDecl>(MethodContext))
+ if (ObjCCategoryDecl *CD = dyn_cast<ObjCCategoryDecl>(MethodContext))
return CD->getClassInterface();
- if (ObjcImplementationDecl *IMD =
- dyn_cast<ObjcImplementationDecl>(MethodContext))
+ if (ObjCImplementationDecl *IMD =
+ dyn_cast<ObjCImplementationDecl>(MethodContext))
return IMD->getClassInterface();
- if (ObjcCategoryImplDecl *CID =
- dyn_cast<ObjcCategoryImplDecl>(MethodContext))
+ if (ObjCCategoryImplDecl *CID =
+ dyn_cast<ObjCCategoryImplDecl>(MethodContext))
return CID->getClassInterface();
assert(false && "unknown method context");
return 0;
Modified: cfe/trunk/AST/DeclSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/DeclSerialization.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/DeclSerialization.cpp (original)
+++ cfe/trunk/AST/DeclSerialization.cpp Mon Jan 7 13:49:32 2008
@@ -217,7 +217,7 @@
void ParmVarDecl::EmitImpl(llvm::Serializer& S) const {
VarDecl::EmitImpl(S);
- S.EmitInt(getObjcDeclQualifier()); // From ParmVarDecl.
+ S.EmitInt(getObjCDeclQualifier()); // From ParmVarDecl.
}
ParmVarDecl* ParmVarDecl::CreateImpl(Deserializer& D) {
@@ -225,7 +225,7 @@
new ParmVarDecl(SourceLocation(),NULL,QualType(),None,NULL);
decl->VarDecl::ReadImpl(D);
- decl->objcDeclQualifier = static_cast<ObjcDeclQualifier>(D.ReadInt());
+ decl->objcDeclQualifier = static_cast<ObjCDeclQualifier>(D.ReadInt());
return decl;
}
Modified: cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Expr.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Mon Jan 7 13:49:32 2008
@@ -985,7 +985,7 @@
// constructor for instance messages.
ObjCMessageExpr::ObjCMessageExpr(Expr *receiver, Selector selInfo,
- QualType retType, ObjcMethodDecl *mproto,
+ QualType retType, ObjCMethodDecl *mproto,
SourceLocation LBrac, SourceLocation RBrac,
Expr **ArgExprs, unsigned nargs)
: Expr(ObjCMessageExprClass, retType), SelName(selInfo),
@@ -1004,7 +1004,7 @@
// constructor for class messages.
// FIXME: clsName should be typed to ObjCInterfaceType
ObjCMessageExpr::ObjCMessageExpr(IdentifierInfo *clsName, Selector selInfo,
- QualType retType, ObjcMethodDecl *mproto,
+ QualType retType, ObjCMethodDecl *mproto,
SourceLocation LBrac, SourceLocation RBrac,
Expr **ArgExprs, unsigned nargs)
: Expr(ObjCMessageExprClass, retType), SelName(selInfo),
Modified: cfe/trunk/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Stmt.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/Stmt.cpp (original)
+++ cfe/trunk/AST/Stmt.cpp Mon Jan 7 13:49:32 2008
@@ -183,11 +183,11 @@
Stmt::child_iterator ForStmt::child_begin() { return &SubExprs[0]; }
Stmt::child_iterator ForStmt::child_end() { return &SubExprs[0]+END_EXPR; }
-// ObjcForCollectionStmt
-Stmt::child_iterator ObjcForCollectionStmt::child_begin() {
+// ObjCForCollectionStmt
+Stmt::child_iterator ObjCForCollectionStmt::child_begin() {
return &SubExprs[0];
}
-Stmt::child_iterator ObjcForCollectionStmt::child_end() {
+Stmt::child_iterator ObjCForCollectionStmt::child_end() {
return &SubExprs[0]+END_EXPR;
}
@@ -225,27 +225,27 @@
Stmt::child_iterator AsmStmt::child_begin() { return child_iterator(); }
Stmt::child_iterator AsmStmt::child_end() { return child_iterator(); }
-// ObjcAtCatchStmt
-Stmt::child_iterator ObjcAtCatchStmt::child_begin() { return &SubExprs[0]; }
-Stmt::child_iterator ObjcAtCatchStmt::child_end() {
+// ObjCAtCatchStmt
+Stmt::child_iterator ObjCAtCatchStmt::child_begin() { return &SubExprs[0]; }
+Stmt::child_iterator ObjCAtCatchStmt::child_end() {
return &SubExprs[0]+END_EXPR;
}
-// ObjcAtFinallyStmt
-Stmt::child_iterator ObjcAtFinallyStmt::child_begin() { return &AtFinallyStmt; }
-Stmt::child_iterator ObjcAtFinallyStmt::child_end() { return &AtFinallyStmt+1; }
-
-// ObjcAtTryStmt
-Stmt::child_iterator ObjcAtTryStmt::child_begin() { return &SubStmts[0]; }
-Stmt::child_iterator ObjcAtTryStmt::child_end() {
+// ObjCAtFinallyStmt
+Stmt::child_iterator ObjCAtFinallyStmt::child_begin() { return &AtFinallyStmt; }
+Stmt::child_iterator ObjCAtFinallyStmt::child_end() { return &AtFinallyStmt+1; }
+
+// ObjCAtTryStmt
+Stmt::child_iterator ObjCAtTryStmt::child_begin() { return &SubStmts[0]; }
+Stmt::child_iterator ObjCAtTryStmt::child_end() {
return &SubStmts[0]+END_EXPR;
}
-// ObjcAtThrowStmt
-Stmt::child_iterator ObjcAtThrowStmt::child_begin() {
+// ObjCAtThrowStmt
+Stmt::child_iterator ObjCAtThrowStmt::child_begin() {
return &Throw;
}
-Stmt::child_iterator ObjcAtThrowStmt::child_end() {
+Stmt::child_iterator ObjCAtThrowStmt::child_end() {
return &Throw+1;
}
Modified: cfe/trunk/AST/StmtDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtDumper.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/StmtDumper.cpp (original)
+++ cfe/trunk/AST/StmtDumper.cpp Mon Jan 7 13:49:32 2008
@@ -284,8 +284,8 @@
case Decl::Union: fprintf(F,"Union"); break;
case Decl::Class: fprintf(F,"Class"); break;
case Decl::Enum: fprintf(F,"Enum"); break;
- case Decl::ObjcInterface: fprintf(F,"ObjcInterface"); break;
- case Decl::ObjcClass: fprintf(F,"ObjcClass"); break;
+ case Decl::ObjCInterface: fprintf(F,"ObjCInterface"); break;
+ case Decl::ObjCClass: fprintf(F,"ObjCClass"); break;
default: fprintf(F,"Decl"); break;
}
Modified: cfe/trunk/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtPrinter.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/AST/StmtPrinter.cpp Mon Jan 7 13:49:32 2008
@@ -296,7 +296,7 @@
}
}
-void StmtPrinter::VisitObjcForCollectionStmt(ObjcForCollectionStmt *Node) {
+void StmtPrinter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *Node) {
Indent() << "for (";
if (DeclStmt *DS = dyn_cast<DeclStmt>(Node->getElement()))
PrintRawDecl(DS->getDecl());
@@ -406,18 +406,18 @@
OS << ");\n";
}
-void StmtPrinter::VisitObjcAtTryStmt(ObjcAtTryStmt *Node) {
+void StmtPrinter::VisitObjCAtTryStmt(ObjCAtTryStmt *Node) {
Indent() << "@try";
if (CompoundStmt *TS = dyn_cast<CompoundStmt>(Node->getTryBody())) {
PrintRawCompoundStmt(TS);
OS << "\n";
}
- for (ObjcAtCatchStmt *catchStmt =
- static_cast<ObjcAtCatchStmt *>(Node->getCatchStmts());
+ for (ObjCAtCatchStmt *catchStmt =
+ static_cast<ObjCAtCatchStmt *>(Node->getCatchStmts());
catchStmt;
catchStmt =
- static_cast<ObjcAtCatchStmt *>(catchStmt->getNextCatchStmt())) {
+ static_cast<ObjCAtCatchStmt *>(catchStmt->getNextCatchStmt())) {
Indent() << "@catch(";
if (catchStmt->getCatchParamStmt()) {
if (DeclStmt *DS = dyn_cast<DeclStmt>(catchStmt->getCatchParamStmt()))
@@ -431,7 +431,7 @@
}
}
- if (ObjcAtFinallyStmt *FS =static_cast<ObjcAtFinallyStmt *>(
+ if (ObjCAtFinallyStmt *FS =static_cast<ObjCAtFinallyStmt *>(
Node->getFinallyStmt())) {
Indent() << "@finally";
PrintRawCompoundStmt(dyn_cast<CompoundStmt>(FS->getFinallyBody()));
@@ -439,14 +439,14 @@
}
}
-void StmtPrinter::VisitObjcAtFinallyStmt(ObjcAtFinallyStmt *Node) {
+void StmtPrinter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *Node) {
}
-void StmtPrinter::VisitObjcAtCatchStmt (ObjcAtCatchStmt *Node) {
+void StmtPrinter::VisitObjCAtCatchStmt (ObjCAtCatchStmt *Node) {
Indent() << "@catch (...) { /* todo */ } \n";
}
-void StmtPrinter::VisitObjcAtThrowStmt (ObjcAtThrowStmt *Node) {
+void StmtPrinter::VisitObjCAtThrowStmt (ObjCAtThrowStmt *Node) {
Indent() << "@throw";
if (Node->getThrowExpr()) {
OS << " ";
Modified: cfe/trunk/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtSerialization.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/AST/StmtSerialization.cpp Mon Jan 7 13:49:32 2008
@@ -156,23 +156,23 @@
// Objective C
//==--------------------------------------==//
- case ObjcAtCatchStmtClass:
- return ObjcAtCatchStmt::CreateImpl(D);
+ case ObjCAtCatchStmtClass:
+ return ObjCAtCatchStmt::CreateImpl(D);
- case ObjcAtFinallyStmtClass:
- return ObjcAtFinallyStmt::CreateImpl(D);
+ case ObjCAtFinallyStmtClass:
+ return ObjCAtFinallyStmt::CreateImpl(D);
- case ObjcAtThrowStmtClass:
- return ObjcAtThrowStmt::CreateImpl(D);
+ case ObjCAtThrowStmtClass:
+ return ObjCAtThrowStmt::CreateImpl(D);
- case ObjcAtTryStmtClass:
- return ObjcAtTryStmt::CreateImpl(D);
+ case ObjCAtTryStmtClass:
+ return ObjCAtTryStmt::CreateImpl(D);
case ObjCEncodeExprClass:
return ObjCEncodeExpr::CreateImpl(D);
- case ObjcForCollectionStmtClass:
- return ObjcForCollectionStmt::CreateImpl(D);
+ case ObjCForCollectionStmtClass:
+ return ObjCForCollectionStmt::CreateImpl(D);
case ObjCIvarRefExprClass:
return ObjCIvarRefExpr::CreateImpl(D);
@@ -851,18 +851,18 @@
// Objective C Serialization
//===----------------------------------------------------------------------===//
-void ObjcAtCatchStmt::EmitImpl(Serializer& S) const {
+void ObjCAtCatchStmt::EmitImpl(Serializer& S) const {
S.Emit(AtCatchLoc);
S.Emit(RParenLoc);
S.EmitPtr(NextAtCatchStmt);
S.BatchEmitOwnedPtrs((unsigned) END_EXPR,&SubExprs[0]);
}
-ObjcAtCatchStmt* ObjcAtCatchStmt::CreateImpl(Deserializer& D) {
+ObjCAtCatchStmt* ObjCAtCatchStmt::CreateImpl(Deserializer& D) {
SourceLocation AtCatchLoc = SourceLocation::ReadVal(D);
SourceLocation RParenLoc = SourceLocation::ReadVal(D);
- ObjcAtCatchStmt* stmt = new ObjcAtCatchStmt(AtCatchLoc,RParenLoc);
+ ObjCAtCatchStmt* stmt = new ObjCAtCatchStmt(AtCatchLoc,RParenLoc);
D.ReadPtr(stmt->NextAtCatchStmt); // Allows backpatching.
D.BatchReadOwnedPtrs((unsigned) END_EXPR, &stmt->SubExprs[0]);
@@ -870,36 +870,36 @@
return stmt;
}
-void ObjcAtFinallyStmt::EmitImpl(Serializer& S) const {
+void ObjCAtFinallyStmt::EmitImpl(Serializer& S) const {
S.Emit(AtFinallyLoc);
S.EmitOwnedPtr(AtFinallyStmt);
}
-ObjcAtFinallyStmt* ObjcAtFinallyStmt::CreateImpl(Deserializer& D) {
+ObjCAtFinallyStmt* ObjCAtFinallyStmt::CreateImpl(Deserializer& D) {
SourceLocation Loc = SourceLocation::ReadVal(D);
Stmt* AtFinallyStmt = D.ReadOwnedPtr<Stmt>();
- return new ObjcAtFinallyStmt(Loc,AtFinallyStmt);
+ return new ObjCAtFinallyStmt(Loc,AtFinallyStmt);
}
-void ObjcAtThrowStmt::EmitImpl(Serializer& S) const {
+void ObjCAtThrowStmt::EmitImpl(Serializer& S) const {
S.Emit(AtThrowLoc);
S.EmitOwnedPtr(Throw);
}
-ObjcAtThrowStmt* ObjcAtThrowStmt::CreateImpl(Deserializer& D) {
+ObjCAtThrowStmt* ObjCAtThrowStmt::CreateImpl(Deserializer& D) {
SourceLocation L = SourceLocation::ReadVal(D);
Stmt* Throw = D.ReadOwnedPtr<Stmt>();
- return new ObjcAtThrowStmt(L,Throw);
+ return new ObjCAtThrowStmt(L,Throw);
}
-void ObjcAtTryStmt::EmitImpl(Serializer& S) const {
+void ObjCAtTryStmt::EmitImpl(Serializer& S) const {
S.Emit(AtTryLoc);
S.BatchEmitOwnedPtrs((unsigned) END_EXPR, &SubStmts[0]);
}
-ObjcAtTryStmt* ObjcAtTryStmt::CreateImpl(Deserializer& D) {
+ObjCAtTryStmt* ObjCAtTryStmt::CreateImpl(Deserializer& D) {
SourceLocation L = SourceLocation::ReadVal(D);
- ObjcAtTryStmt* stmt = new ObjcAtTryStmt(L,NULL,NULL,NULL);
+ ObjCAtTryStmt* stmt = new ObjCAtTryStmt(L,NULL,NULL,NULL);
D.BatchReadOwnedPtrs((unsigned) END_EXPR, &stmt->SubStmts[0]);
return stmt;
}
@@ -919,18 +919,18 @@
return new ObjCEncodeExpr(T,ET,AtLoc,RParenLoc);
}
-void ObjcForCollectionStmt::EmitImpl(Serializer& S) const {
+void ObjCForCollectionStmt::EmitImpl(Serializer& S) const {
S.Emit(ForLoc);
S.BatchEmitOwnedPtrs(getElement(),getCollection(),getBody());
}
-ObjcForCollectionStmt* ObjcForCollectionStmt::CreateImpl(Deserializer& D) {
+ObjCForCollectionStmt* ObjCForCollectionStmt::CreateImpl(Deserializer& D) {
SourceLocation ForLoc = SourceLocation::ReadVal(D);
Stmt* Element;
Expr* Collection;
Stmt* Body;
D.BatchReadOwnedPtrs(Element,Collection,Body);
- return new ObjcForCollectionStmt(Element,Collection,Body,ForLoc);
+ return new ObjCForCollectionStmt(Element,Collection,Body,ForLoc);
}
void ObjCIvarRefExpr::EmitImpl(Serializer& S) const {
Modified: cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Type.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/AST/Type.cpp (original)
+++ cfe/trunk/AST/Type.cpp Mon Jan 7 13:49:32 2008
@@ -434,7 +434,7 @@
}
return isa<PointerType>(CanonicalType) || isa<ComplexType>(CanonicalType) ||
isa<VectorType>(CanonicalType) ||
- isa<ObjcQualifiedIdType>(CanonicalType);
+ isa<ObjCQualifiedIdType>(CanonicalType);
}
bool Type::isAggregateType() const {
@@ -529,25 +529,25 @@
Profile(ID, getResultType(), arg_type_begin(), NumArgs, isVariadic());
}
-void ObjcQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID,
- ObjcProtocolDecl **protocols,
+void ObjCQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID,
+ ObjCProtocolDecl **protocols,
unsigned NumProtocols) {
for (unsigned i = 0; i != NumProtocols; i++)
ID.AddPointer(protocols[i]);
}
-void ObjcQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID) {
+void ObjCQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID) {
Profile(ID, &Protocols[0], getNumProtocols());
}
-void ObjcQualifiedIdType::Profile(llvm::FoldingSetNodeID &ID,
- ObjcProtocolDecl **protocols,
+void ObjCQualifiedIdType::Profile(llvm::FoldingSetNodeID &ID,
+ ObjCProtocolDecl **protocols,
unsigned NumProtocols) {
for (unsigned i = 0; i != NumProtocols; i++)
ID.AddPointer(protocols[i]);
}
-void ObjcQualifiedIdType::Profile(llvm::FoldingSetNodeID &ID) {
+void ObjCQualifiedIdType::Profile(llvm::FoldingSetNodeID &ID) {
Profile(ID, &Protocols[0], getNumProtocols());
}
@@ -770,42 +770,42 @@
InnerString = getDecl()->getIdentifier()->getName() + InnerString;
}
-void ObjcInterfaceType::getAsStringInternal(std::string &InnerString) const {
+void ObjCInterfaceType::getAsStringInternal(std::string &InnerString) const {
if (!InnerString.empty()) // Prefix the basic type, e.g. 'typedefname X'.
InnerString = ' ' + InnerString;
InnerString = getDecl()->getIdentifier()->getName() + InnerString;
}
-void ObjcQualifiedInterfaceType::getAsStringInternal(
+void ObjCQualifiedInterfaceType::getAsStringInternal(
std::string &InnerString) const {
if (!InnerString.empty()) // Prefix the basic type, e.g. 'typedefname X'.
InnerString = ' ' + InnerString;
- std::string ObjcQIString = getDecl()->getName();
- ObjcQIString += '<';
+ std::string ObjCQIString = getDecl()->getName();
+ ObjCQIString += '<';
int num = getNumProtocols();
for (int i = 0; i < num; i++) {
- ObjcQIString += getProtocols(i)->getName();
+ ObjCQIString += getProtocols(i)->getName();
if (i < num-1)
- ObjcQIString += ',';
+ ObjCQIString += ',';
}
- ObjcQIString += '>';
- InnerString = ObjcQIString + InnerString;
+ ObjCQIString += '>';
+ InnerString = ObjCQIString + InnerString;
}
-void ObjcQualifiedIdType::getAsStringInternal(
+void ObjCQualifiedIdType::getAsStringInternal(
std::string &InnerString) const {
if (!InnerString.empty()) // Prefix the basic type, e.g. 'typedefname X'.
InnerString = ' ' + InnerString;
- std::string ObjcQIString = "id";
- ObjcQIString += '<';
+ std::string ObjCQIString = "id";
+ ObjCQIString += '<';
int num = getNumProtocols();
for (int i = 0; i < num; i++) {
- ObjcQIString += getProtocols(i)->getName();
+ ObjCQIString += getProtocols(i)->getName();
if (i < num-1)
- ObjcQIString += ',';
+ ObjCQIString += ',';
}
- ObjcQIString += '>';
- InnerString = ObjcQIString + InnerString;
+ ObjCQIString += '>';
+ InnerString = ObjCQIString + InnerString;
}
void TagType::getAsStringInternal(std::string &InnerString) const {
Modified: cfe/trunk/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprScalar.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/CodeGen/CGExprScalar.cpp Mon Jan 7 13:49:32 2008
@@ -1001,7 +1001,7 @@
Value *ScalarExprEmitter::VisitObjCEncodeExpr(const ObjCEncodeExpr *E) {
std::string str;
- CGF.getContext().getObjcEncodingForType(E->getEncodedType(), str);
+ CGF.getContext().getObjCEncodingForType(E->getEncodedType(), str);
llvm::Constant *C = llvm::ConstantArray::get(str);
C = new llvm::GlobalVariable(C->getType(), true,
Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Mon Jan 7 13:49:32 2008
@@ -265,15 +265,15 @@
return llvm::FunctionType::get(ResultType, ArgTys, isVarArg);
}
- case Type::ObjcInterface:
+ case Type::ObjCInterface:
assert(0 && "FIXME: add missing functionality here");
break;
- case Type::ObjcQualifiedInterface:
+ case Type::ObjCQualifiedInterface:
assert(0 && "FIXME: add missing functionality here");
break;
- case Type::ObjcQualifiedId:
+ case Type::ObjCQualifiedId:
assert(0 && "FIXME: add missing functionality here");
break;
Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Mon Jan 7 13:49:32 2008
@@ -39,13 +39,13 @@
void PrintDecl(Decl *D);
void PrintFunctionDeclStart(FunctionDecl *FD);
void PrintTypeDefDecl(TypedefDecl *TD);
- void PrintObjcMethodDecl(ObjcMethodDecl *OMD);
- void PrintObjcImplementationDecl(ObjcImplementationDecl *OID);
- void PrintObjcInterfaceDecl(ObjcInterfaceDecl *OID);
- void PrintObjcProtocolDecl(ObjcProtocolDecl *PID);
- void PrintObjcCategoryImplDecl(ObjcCategoryImplDecl *PID);
- void PrintObjcCategoryDecl(ObjcCategoryDecl *PID);
- void PrintObjcCompatibleAliasDecl(ObjcCompatibleAliasDecl *AID);
+ void PrintObjCMethodDecl(ObjCMethodDecl *OMD);
+ void PrintObjCImplementationDecl(ObjCImplementationDecl *OID);
+ void PrintObjCInterfaceDecl(ObjCInterfaceDecl *OID);
+ void PrintObjCProtocolDecl(ObjCProtocolDecl *PID);
+ void PrintObjCCategoryImplDecl(ObjCCategoryImplDecl *PID);
+ void PrintObjCCategoryDecl(ObjCCategoryDecl *PID);
+ void PrintObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *AID);
};
} // end anonymous namespace
@@ -58,37 +58,37 @@
FD->getBody()->printPretty(Out);
Out << '\n';
}
- } else if (isa<ObjcMethodDecl>(D)) {
+ } else if (isa<ObjCMethodDecl>(D)) {
// Do nothing, methods definitions are printed in
- // PrintObjcImplementationDecl.
+ // PrintObjCImplementationDecl.
} else if (TypedefDecl *TD = dyn_cast<TypedefDecl>(D)) {
PrintTypeDefDecl(TD);
- } else if (ObjcInterfaceDecl *OID = dyn_cast<ObjcInterfaceDecl>(D)) {
- PrintObjcInterfaceDecl(OID);
- } else if (ObjcProtocolDecl *PID = dyn_cast<ObjcProtocolDecl>(D)) {
- PrintObjcProtocolDecl(PID);
- } else if (ObjcForwardProtocolDecl *OFPD =
- dyn_cast<ObjcForwardProtocolDecl>(D)) {
+ } else if (ObjCInterfaceDecl *OID = dyn_cast<ObjCInterfaceDecl>(D)) {
+ PrintObjCInterfaceDecl(OID);
+ } else if (ObjCProtocolDecl *PID = dyn_cast<ObjCProtocolDecl>(D)) {
+ PrintObjCProtocolDecl(PID);
+ } else if (ObjCForwardProtocolDecl *OFPD =
+ dyn_cast<ObjCForwardProtocolDecl>(D)) {
Out << "@protocol ";
for (unsigned i = 0, e = OFPD->getNumForwardDecls(); i != e; ++i) {
- const ObjcProtocolDecl *D = OFPD->getForwardProtocolDecl(i);
+ const ObjCProtocolDecl *D = OFPD->getForwardProtocolDecl(i);
if (i) Out << ", ";
Out << D->getName();
}
Out << ";\n";
- } else if (ObjcImplementationDecl *OID =
- dyn_cast<ObjcImplementationDecl>(D)) {
- PrintObjcImplementationDecl(OID);
- } else if (ObjcCategoryImplDecl *OID =
- dyn_cast<ObjcCategoryImplDecl>(D)) {
- PrintObjcCategoryImplDecl(OID);
- } else if (ObjcCategoryDecl *OID =
- dyn_cast<ObjcCategoryDecl>(D)) {
- PrintObjcCategoryDecl(OID);
- } else if (ObjcCompatibleAliasDecl *OID =
- dyn_cast<ObjcCompatibleAliasDecl>(D)) {
- PrintObjcCompatibleAliasDecl(OID);
- } else if (isa<ObjcClassDecl>(D)) {
+ } else if (ObjCImplementationDecl *OID =
+ dyn_cast<ObjCImplementationDecl>(D)) {
+ PrintObjCImplementationDecl(OID);
+ } else if (ObjCCategoryImplDecl *OID =
+ dyn_cast<ObjCCategoryImplDecl>(D)) {
+ PrintObjCCategoryImplDecl(OID);
+ } else if (ObjCCategoryDecl *OID =
+ dyn_cast<ObjCCategoryDecl>(D)) {
+ PrintObjCCategoryDecl(OID);
+ } else if (ObjCCompatibleAliasDecl *OID =
+ dyn_cast<ObjCCompatibleAliasDecl>(D)) {
+ PrintObjCCompatibleAliasDecl(OID);
+ } else if (isa<ObjCClassDecl>(D)) {
Out << "@class [printing todo]\n";
} else if (TagDecl *TD = dyn_cast<TagDecl>(D)) {
Out << "Read top-level tag decl: '" << TD->getName() << "'\n";
@@ -152,7 +152,7 @@
Out << "typedef " << S << ";\n";
}
-void DeclPrinter::PrintObjcMethodDecl(ObjcMethodDecl *OMD) {
+void DeclPrinter::PrintObjCMethodDecl(ObjCMethodDecl *OMD) {
if (OMD->isInstance())
Out << "\n- ";
else
@@ -169,19 +169,19 @@
}
}
-void DeclPrinter::PrintObjcImplementationDecl(ObjcImplementationDecl *OID) {
+void DeclPrinter::PrintObjCImplementationDecl(ObjCImplementationDecl *OID) {
std::string I = OID->getName();
- ObjcInterfaceDecl *SID = OID->getSuperClass();
+ ObjCInterfaceDecl *SID = OID->getSuperClass();
if (SID)
Out << "@implementation " << I << " : " << SID->getName();
else
Out << "@implementation " << I;
- for (ObjcImplementationDecl::instmeth_iterator I = OID->instmeth_begin(),
+ for (ObjCImplementationDecl::instmeth_iterator I = OID->instmeth_begin(),
E = OID->instmeth_end(); I != E; ++I) {
- ObjcMethodDecl *OMD = *I;
- PrintObjcMethodDecl(OMD);
+ ObjCMethodDecl *OMD = *I;
+ PrintObjCMethodDecl(OMD);
if (OMD->getBody()) {
Out << ' ';
OMD->getBody()->printPretty(Out);
@@ -189,10 +189,10 @@
}
}
- for (ObjcImplementationDecl::classmeth_iterator I = OID->classmeth_begin(),
+ for (ObjCImplementationDecl::classmeth_iterator I = OID->classmeth_begin(),
E = OID->classmeth_end(); I != E; ++I) {
- ObjcMethodDecl *OMD = *I;
- PrintObjcMethodDecl(OMD);
+ ObjCMethodDecl *OMD = *I;
+ PrintObjCMethodDecl(OMD);
if (OMD->getBody()) {
Out << ' ';
OMD->getBody()->printPretty(Out);
@@ -204,9 +204,9 @@
}
-void DeclPrinter::PrintObjcInterfaceDecl(ObjcInterfaceDecl *OID) {
+void DeclPrinter::PrintObjCInterfaceDecl(ObjCInterfaceDecl *OID) {
std::string I = OID->getName();
- ObjcInterfaceDecl *SID = OID->getSuperClass();
+ ObjCInterfaceDecl *SID = OID->getSuperClass();
if (SID)
Out << "@interface " << I << " : " << SID->getName();
@@ -217,7 +217,7 @@
int count = OID->getNumIntfRefProtocols();
if (count > 0) {
- ObjcProtocolDecl **refProtocols = OID->getReferencedProtocols();
+ ObjCProtocolDecl **refProtocols = OID->getReferencedProtocols();
for (int i = 0; i < count; i++)
Out << (i == 0 ? '<' : ',') << refProtocols[i]->getName();
}
@@ -229,7 +229,7 @@
if (OID->getNumInstanceVariables() > 0) {
Out << '{';
- for (ObjcInterfaceDecl::ivar_iterator I = OID->ivar_begin(),
+ for (ObjCInterfaceDecl::ivar_iterator I = OID->ivar_begin(),
E = OID->ivar_end(); I != E; ++I) {
Out << '\t' << (*I)->getType().getAsString()
<< ' ' << (*I)->getName() << ";\n";
@@ -240,55 +240,55 @@
int NumProperties = OID->getNumPropertyDecl();
if (NumProperties > 0) {
for (int i = 0; i < NumProperties; i++) {
- ObjcPropertyDecl *PDecl = OID->getPropertyDecl()[i];
+ ObjCPropertyDecl *PDecl = OID->getPropertyDecl()[i];
Out << "@property";
- if (PDecl->getPropertyAttributes() != ObjcPropertyDecl::OBJC_PR_noattr) {
+ if (PDecl->getPropertyAttributes() != ObjCPropertyDecl::OBJC_PR_noattr) {
bool first = true;
Out << " (";
- if (PDecl->getPropertyAttributes() & ObjcPropertyDecl::OBJC_PR_readonly)
+ if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readonly)
{
Out << (first ? ' ' : ',') << "readonly";
first = false;
}
- if (PDecl->getPropertyAttributes() & ObjcPropertyDecl::OBJC_PR_getter)
+ if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_getter)
{
Out << (first ? ' ' : ',') << "getter = "
<< PDecl->getGetterName()->getName();
first = false;
}
- if (PDecl->getPropertyAttributes() & ObjcPropertyDecl::OBJC_PR_setter)
+ if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_setter)
{
Out << (first ? ' ' : ',') << "setter = "
<< PDecl->getSetterName()->getName();
first = false;
}
- if (PDecl->getPropertyAttributes() & ObjcPropertyDecl::OBJC_PR_assign)
+ if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_assign)
{
Out << (first ? ' ' : ',') << "assign";
first = false;
}
- if (PDecl->getPropertyAttributes() & ObjcPropertyDecl::OBJC_PR_readwrite)
+ if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readwrite)
{
Out << (first ? ' ' : ',') << "readwrite";
first = false;
}
- if (PDecl->getPropertyAttributes() & ObjcPropertyDecl::OBJC_PR_retain)
+ if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_retain)
{
Out << (first ? ' ' : ',') << "retain";
first = false;
}
- if (PDecl->getPropertyAttributes() & ObjcPropertyDecl::OBJC_PR_copy)
+ if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_copy)
{
Out << (first ? ' ' : ',') << "copy";
first = false;
}
- if (PDecl->getPropertyAttributes() & ObjcPropertyDecl::OBJC_PR_nonatomic)
+ if (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_nonatomic)
{
Out << (first ? ' ' : ',') << "nonatomic";
first = false;
@@ -296,7 +296,7 @@
Out << " )";
}
- ObjcIvarDecl **IDecl = PDecl->getPropertyDecls();
+ ObjCIvarDecl **IDecl = PDecl->getPropertyDecls();
Out << ' ' << IDecl[0]->getType().getAsString()
<< ' ' << IDecl[0]->getName();
@@ -312,12 +312,12 @@
// FIXME: implement the rest...
}
-void DeclPrinter::PrintObjcProtocolDecl(ObjcProtocolDecl *PID) {
+void DeclPrinter::PrintObjCProtocolDecl(ObjCProtocolDecl *PID) {
Out << "@protocol " << PID->getName() << '\n';
// FIXME: implement the rest...
}
-void DeclPrinter::PrintObjcCategoryImplDecl(ObjcCategoryImplDecl *PID) {
+void DeclPrinter::PrintObjCCategoryImplDecl(ObjCCategoryImplDecl *PID) {
Out << "@implementation "
<< PID->getClassInterface()->getName()
<< '(' << PID->getName() << ");\n";
@@ -325,14 +325,14 @@
// FIXME: implement the rest...
}
-void DeclPrinter::PrintObjcCategoryDecl(ObjcCategoryDecl *PID) {
+void DeclPrinter::PrintObjCCategoryDecl(ObjCCategoryDecl *PID) {
Out << "@interface "
<< PID->getClassInterface()->getName()
<< '(' << PID->getName() << ");\n";
// FIXME: implement the rest...
}
-void DeclPrinter::PrintObjcCompatibleAliasDecl(ObjcCompatibleAliasDecl *AID) {
+void DeclPrinter::PrintObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *AID) {
Out << "@compatibility_alias " << AID->getName()
<< ' ' << AID->getClassInterface()->getName() << ";\n";
}
@@ -382,15 +382,15 @@
PrintTypeDefDecl(TD);
} else if (ScopedDecl *SD = dyn_cast<ScopedDecl>(D)) {
Out << "Read top-level variable decl: '" << SD->getName() << "'\n";
- } else if (ObjcInterfaceDecl *OID = dyn_cast<ObjcInterfaceDecl>(D)) {
+ } else if (ObjCInterfaceDecl *OID = dyn_cast<ObjCInterfaceDecl>(D)) {
Out << "Read objc interface '" << OID->getName() << "'\n";
- } else if (ObjcProtocolDecl *OPD = dyn_cast<ObjcProtocolDecl>(D)) {
+ } else if (ObjCProtocolDecl *OPD = dyn_cast<ObjCProtocolDecl>(D)) {
Out << "Read objc protocol '" << OPD->getName() << "'\n";
- } else if (ObjcCategoryDecl *OCD = dyn_cast<ObjcCategoryDecl>(D)) {
+ } else if (ObjCCategoryDecl *OCD = dyn_cast<ObjCCategoryDecl>(D)) {
Out << "Read objc category '" << OCD->getName() << "'\n";
- } else if (isa<ObjcForwardProtocolDecl>(D)) {
+ } else if (isa<ObjCForwardProtocolDecl>(D)) {
Out << "Read objc fwd protocol decl\n";
- } else if (isa<ObjcClassDecl>(D)) {
+ } else if (isa<ObjCClassDecl>(D)) {
Out << "Read objc fwd class decl\n";
} else {
assert(0 && "Unknown decl type!");
Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Mon Jan 7 13:49:32 2008
@@ -35,11 +35,11 @@
unsigned MainFileID;
const char *MainFileStart, *MainFileEnd;
SourceLocation LastIncLoc;
- llvm::SmallVector<ObjcImplementationDecl *, 8> ClassImplementation;
- llvm::SmallVector<ObjcCategoryImplDecl *, 8> CategoryImplementation;
- llvm::SmallPtrSet<ObjcInterfaceDecl*, 8> ObjcSynthesizedStructs;
- llvm::SmallPtrSet<ObjcInterfaceDecl*, 8> ObjcForwardDecls;
- llvm::DenseMap<ObjcMethodDecl*, std::string> MethodInternalNames;
+ llvm::SmallVector<ObjCImplementationDecl *, 8> ClassImplementation;
+ llvm::SmallVector<ObjCCategoryImplDecl *, 8> CategoryImplementation;
+ llvm::SmallPtrSet<ObjCInterfaceDecl*, 8> ObjCSynthesizedStructs;
+ llvm::SmallPtrSet<ObjCInterfaceDecl*, 8> ObjCForwardDecls;
+ llvm::DenseMap<ObjCMethodDecl*, std::string> MethodInternalNames;
FunctionDecl *MsgSendFunctionDecl;
FunctionDecl *MsgSendSuperFunctionDecl;
@@ -57,7 +57,7 @@
RecordDecl *NSStringRecord;
// Needed for super.
- ObjcMethodDecl *CurMethodDecl;
+ ObjCMethodDecl *CurMethodDecl;
RecordDecl *SuperStructDecl;
static const int OBJC_ABI_VERSION =7 ;
@@ -137,19 +137,19 @@
void RewritePrologue(SourceLocation Loc);
void RewriteInclude(SourceLocation Loc);
void RewriteTabs();
- void RewriteForwardClassDecl(ObjcClassDecl *Dcl);
- void RewriteInterfaceDecl(ObjcInterfaceDecl *Dcl);
+ void RewriteForwardClassDecl(ObjCClassDecl *Dcl);
+ void RewriteInterfaceDecl(ObjCInterfaceDecl *Dcl);
void RewriteImplementationDecl(NamedDecl *Dcl);
- void RewriteObjcMethodDecl(ObjcMethodDecl *MDecl, std::string &ResultStr);
- void RewriteCategoryDecl(ObjcCategoryDecl *Dcl);
- void RewriteProtocolDecl(ObjcProtocolDecl *Dcl);
- void RewriteForwardProtocolDecl(ObjcForwardProtocolDecl *Dcl);
- void RewriteMethodDeclaration(ObjcMethodDecl *Method);
- void RewriteProperties(int nProperties, ObjcPropertyDecl **Properties);
+ void RewriteObjCMethodDecl(ObjCMethodDecl *MDecl, std::string &ResultStr);
+ void RewriteCategoryDecl(ObjCCategoryDecl *Dcl);
+ void RewriteProtocolDecl(ObjCProtocolDecl *Dcl);
+ void RewriteForwardProtocolDecl(ObjCForwardProtocolDecl *Dcl);
+ void RewriteMethodDeclaration(ObjCMethodDecl *Method);
+ void RewriteProperties(int nProperties, ObjCPropertyDecl **Properties);
void RewriteFunctionDecl(FunctionDecl *FD);
- void RewriteObjcQualifiedInterfaceTypes(Decl *Dcl);
+ void RewriteObjCQualifiedInterfaceTypes(Decl *Dcl);
bool needToScanForQualifiers(QualType T);
- ObjcInterfaceDecl *isSuperReceiver(Expr *recExpr);
+ ObjCInterfaceDecl *isSuperReceiver(Expr *recExpr);
QualType getSuperStructType();
// Expression Rewriting.
@@ -160,10 +160,10 @@
Stmt *RewriteMessageExpr(ObjCMessageExpr *Exp);
Stmt *RewriteObjCStringLiteral(ObjCStringLiteral *Exp);
Stmt *RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp);
- Stmt *RewriteObjcTryStmt(ObjcAtTryStmt *S);
- Stmt *RewriteObjcCatchStmt(ObjcAtCatchStmt *S);
- Stmt *RewriteObjcFinallyStmt(ObjcAtFinallyStmt *S);
- Stmt *RewriteObjcThrowStmt(ObjcAtThrowStmt *S);
+ Stmt *RewriteObjCTryStmt(ObjCAtTryStmt *S);
+ Stmt *RewriteObjCCatchStmt(ObjCAtCatchStmt *S);
+ Stmt *RewriteObjCFinallyStmt(ObjCAtFinallyStmt *S);
+ Stmt *RewriteObjCThrowStmt(ObjCAtThrowStmt *S);
CallExpr *SynthesizeCallToFunctionDecl(FunctionDecl *FD,
Expr **args, unsigned nargs);
void SynthMsgSendFunctionDecl();
@@ -178,29 +178,29 @@
void SynthGetProtocolFunctionDecl();
// Metadata emission.
- void RewriteObjcClassMetaData(ObjcImplementationDecl *IDecl,
+ void RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl,
std::string &Result);
- void RewriteObjcCategoryImplDecl(ObjcCategoryImplDecl *CDecl,
+ void RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *CDecl,
std::string &Result);
- typedef ObjcCategoryImplDecl::instmeth_iterator instmeth_iterator;
- void RewriteObjcMethodsMetaData(instmeth_iterator MethodBegin,
+ typedef ObjCCategoryImplDecl::instmeth_iterator instmeth_iterator;
+ void RewriteObjCMethodsMetaData(instmeth_iterator MethodBegin,
instmeth_iterator MethodEnd,
bool IsInstanceMethod,
const char *prefix,
const char *ClassName,
std::string &Result);
- void RewriteObjcProtocolsMetaData(ObjcProtocolDecl **Protocols,
+ void RewriteObjCProtocolsMetaData(ObjCProtocolDecl **Protocols,
int NumProtocols,
const char *prefix,
const char *ClassName,
std::string &Result);
- void SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl,
+ void SynthesizeObjCInternalStruct(ObjCInterfaceDecl *CDecl,
std::string &Result);
- void SynthesizeIvarOffsetComputation(ObjcImplementationDecl *IDecl,
- ObjcIvarDecl *ivar,
+ void SynthesizeIvarOffsetComputation(ObjCImplementationDecl *IDecl,
+ ObjCIvarDecl *ivar,
std::string &Result);
void RewriteImplementations(std::string &Result);
};
@@ -233,14 +233,14 @@
ConstantStringClassReference = FVD;
return;
}
- } else if (ObjcInterfaceDecl *MD = dyn_cast<ObjcInterfaceDecl>(D)) {
+ } else if (ObjCInterfaceDecl *MD = dyn_cast<ObjCInterfaceDecl>(D)) {
RewriteInterfaceDecl(MD);
- } else if (ObjcCategoryDecl *CD = dyn_cast<ObjcCategoryDecl>(D)) {
+ } else if (ObjCCategoryDecl *CD = dyn_cast<ObjCCategoryDecl>(D)) {
RewriteCategoryDecl(CD);
- } else if (ObjcProtocolDecl *PD = dyn_cast<ObjcProtocolDecl>(D)) {
+ } else if (ObjCProtocolDecl *PD = dyn_cast<ObjCProtocolDecl>(D)) {
RewriteProtocolDecl(PD);
- } else if (ObjcForwardProtocolDecl *FP =
- dyn_cast<ObjcForwardProtocolDecl>(D)){
+ } else if (ObjCForwardProtocolDecl *FP =
+ dyn_cast<ObjCForwardProtocolDecl>(D)){
RewriteForwardProtocolDecl(FP);
}
// If we have a decl in the main file, see if we should rewrite it.
@@ -259,7 +259,7 @@
if (Stmt *Body = FD->getBody())
FD->setBody(RewriteFunctionBodyOrGlobalInitializer(Body));
- if (ObjcMethodDecl *MD = dyn_cast<ObjcMethodDecl>(D)) {
+ if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D)) {
if (Stmt *Body = MD->getBody()) {
//Body->dump();
CurMethodDecl = MD;
@@ -267,14 +267,14 @@
CurMethodDecl = 0;
}
}
- if (ObjcImplementationDecl *CI = dyn_cast<ObjcImplementationDecl>(D))
+ if (ObjCImplementationDecl *CI = dyn_cast<ObjCImplementationDecl>(D))
ClassImplementation.push_back(CI);
- else if (ObjcCategoryImplDecl *CI = dyn_cast<ObjcCategoryImplDecl>(D))
+ else if (ObjCCategoryImplDecl *CI = dyn_cast<ObjCCategoryImplDecl>(D))
CategoryImplementation.push_back(CI);
- else if (ObjcClassDecl *CD = dyn_cast<ObjcClassDecl>(D))
+ else if (ObjCClassDecl *CD = dyn_cast<ObjCClassDecl>(D))
RewriteForwardClassDecl(CD);
else if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
- RewriteObjcQualifiedInterfaceTypes(VD);
+ RewriteObjCQualifiedInterfaceTypes(VD);
if (VD->getInit())
RewriteFunctionBodyOrGlobalInitializer(VD->getInit());
}
@@ -364,9 +364,9 @@
}
-void RewriteTest::RewriteForwardClassDecl(ObjcClassDecl *ClassDecl) {
+void RewriteTest::RewriteForwardClassDecl(ObjCClassDecl *ClassDecl) {
int numDecls = ClassDecl->getNumForwardDecls();
- ObjcInterfaceDecl **ForwardDecls = ClassDecl->getForwardDecls();
+ ObjCInterfaceDecl **ForwardDecls = ClassDecl->getForwardDecls();
// Get the start location and compute the semi location.
SourceLocation startLoc = ClassDecl->getLocation();
@@ -381,7 +381,7 @@
typedefString.append(startBuf, semiPtr-startBuf+1);
typedefString += "\n";
for (int i = 0; i < numDecls; i++) {
- ObjcInterfaceDecl *ForwardDecl = ForwardDecls[i];
+ ObjCInterfaceDecl *ForwardDecl = ForwardDecls[i];
typedefString += "#ifndef _REWRITER_typedef_";
typedefString += ForwardDecl->getName();
typedefString += "\n";
@@ -398,7 +398,7 @@
typedefString.c_str(), typedefString.size());
}
-void RewriteTest::RewriteMethodDeclaration(ObjcMethodDecl *Method) {
+void RewriteTest::RewriteMethodDeclaration(ObjCMethodDecl *Method) {
SourceLocation LocStart = Method->getLocStart();
SourceLocation LocEnd = Method->getLocEnd();
@@ -410,10 +410,10 @@
}
}
-void RewriteTest::RewriteProperties(int nProperties, ObjcPropertyDecl **Properties)
+void RewriteTest::RewriteProperties(int nProperties, ObjCPropertyDecl **Properties)
{
for (int i = 0; i < nProperties; i++) {
- ObjcPropertyDecl *Property = Properties[i];
+ ObjCPropertyDecl *Property = Properties[i];
SourceLocation Loc = Property->getLocation();
Rewrite.ReplaceText(Loc, 0, "// ", 3);
@@ -422,16 +422,16 @@
}
}
-void RewriteTest::RewriteCategoryDecl(ObjcCategoryDecl *CatDecl) {
+void RewriteTest::RewriteCategoryDecl(ObjCCategoryDecl *CatDecl) {
SourceLocation LocStart = CatDecl->getLocStart();
// FIXME: handle category headers that are declared across multiple lines.
Rewrite.ReplaceText(LocStart, 0, "// ", 3);
- for (ObjcCategoryDecl::instmeth_iterator I = CatDecl->instmeth_begin(),
+ for (ObjCCategoryDecl::instmeth_iterator I = CatDecl->instmeth_begin(),
E = CatDecl->instmeth_end(); I != E; ++I)
RewriteMethodDeclaration(*I);
- for (ObjcCategoryDecl::classmeth_iterator I = CatDecl->classmeth_begin(),
+ for (ObjCCategoryDecl::classmeth_iterator I = CatDecl->classmeth_begin(),
E = CatDecl->classmeth_end(); I != E; ++I)
RewriteMethodDeclaration(*I);
@@ -439,7 +439,7 @@
Rewrite.ReplaceText(CatDecl->getAtEndLoc(), 0, "// ", 3);
}
-void RewriteTest::RewriteProtocolDecl(ObjcProtocolDecl *PDecl) {
+void RewriteTest::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) {
std::pair<const char*, const char*> MainBuf = SM->getBufferData(MainFileID);
SourceLocation LocStart = PDecl->getLocStart();
@@ -447,10 +447,10 @@
// FIXME: handle protocol headers that are declared across multiple lines.
Rewrite.ReplaceText(LocStart, 0, "// ", 3);
- for (ObjcProtocolDecl::instmeth_iterator I = PDecl->instmeth_begin(),
+ for (ObjCProtocolDecl::instmeth_iterator I = PDecl->instmeth_begin(),
E = PDecl->instmeth_end(); I != E; ++I)
RewriteMethodDeclaration(*I);
- for (ObjcProtocolDecl::classmeth_iterator I = PDecl->classmeth_begin(),
+ for (ObjCProtocolDecl::classmeth_iterator I = PDecl->classmeth_begin(),
E = PDecl->classmeth_end(); I != E; ++I)
RewriteMethodDeclaration(*I);
@@ -479,7 +479,7 @@
}
}
-void RewriteTest::RewriteForwardProtocolDecl(ObjcForwardProtocolDecl *PDecl) {
+void RewriteTest::RewriteForwardProtocolDecl(ObjCForwardProtocolDecl *PDecl) {
SourceLocation LocStart = PDecl->getLocation();
if (LocStart.isInvalid())
assert(false && "Invalid SourceLocation");
@@ -487,10 +487,10 @@
Rewrite.ReplaceText(LocStart, 0, "// ", 3);
}
-void RewriteTest::RewriteObjcMethodDecl(ObjcMethodDecl *OMD,
+void RewriteTest::RewriteObjCMethodDecl(ObjCMethodDecl *OMD,
std::string &ResultStr) {
ResultStr += "\nstatic ";
- if (OMD->getResultType()->isObjcQualifiedIdType())
+ if (OMD->getResultType()->isObjCQualifiedIdType())
ResultStr += "id";
else
ResultStr += OMD->getResultType().getAsString();
@@ -508,8 +508,8 @@
NameStr += "_";
NamedDecl *MethodContext = OMD->getMethodContext();
- if (ObjcCategoryImplDecl *CID =
- dyn_cast<ObjcCategoryImplDecl>(MethodContext)) {
+ if (ObjCCategoryImplDecl *CID =
+ dyn_cast<ObjCCategoryImplDecl>(MethodContext)) {
NameStr += CID->getName();
NameStr += "_";
}
@@ -534,24 +534,24 @@
// invisible arguments
if (OMD->isInstance()) {
- QualType selfTy = Context->getObjcInterfaceType(OMD->getClassInterface());
+ QualType selfTy = Context->getObjCInterfaceType(OMD->getClassInterface());
selfTy = Context->getPointerType(selfTy);
- if (ObjcSynthesizedStructs.count(OMD->getClassInterface()))
+ if (ObjCSynthesizedStructs.count(OMD->getClassInterface()))
ResultStr += "struct ";
ResultStr += selfTy.getAsString();
}
else
- ResultStr += Context->getObjcIdType().getAsString();
+ ResultStr += Context->getObjCIdType().getAsString();
ResultStr += " self, ";
- ResultStr += Context->getObjcSelType().getAsString();
+ ResultStr += Context->getObjCSelType().getAsString();
ResultStr += " _cmd";
// Method arguments.
for (int i = 0; i < OMD->getNumParams(); i++) {
ParmVarDecl *PDecl = OMD->getParamDecl(i);
ResultStr += ", ";
- if (PDecl->getType()->isObjcQualifiedIdType())
+ if (PDecl->getType()->isObjCQualifiedIdType())
ResultStr += "id";
else
ResultStr += PDecl->getType().getAsString();
@@ -562,20 +562,20 @@
}
void RewriteTest::RewriteImplementationDecl(NamedDecl *OID) {
- ObjcImplementationDecl *IMD = dyn_cast<ObjcImplementationDecl>(OID);
- ObjcCategoryImplDecl *CID = dyn_cast<ObjcCategoryImplDecl>(OID);
+ ObjCImplementationDecl *IMD = dyn_cast<ObjCImplementationDecl>(OID);
+ ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(OID);
if (IMD)
Rewrite.InsertText(IMD->getLocStart(), "// ", 3);
else
Rewrite.InsertText(CID->getLocStart(), "// ", 3);
- for (ObjcCategoryImplDecl::instmeth_iterator
+ for (ObjCCategoryImplDecl::instmeth_iterator
I = IMD ? IMD->instmeth_begin() : CID->instmeth_begin(),
E = IMD ? IMD->instmeth_end() : CID->instmeth_end(); I != E; ++I) {
std::string ResultStr;
- ObjcMethodDecl *OMD = *I;
- RewriteObjcMethodDecl(OMD, ResultStr);
+ ObjCMethodDecl *OMD = *I;
+ RewriteObjCMethodDecl(OMD, ResultStr);
SourceLocation LocStart = OMD->getLocStart();
SourceLocation LocEnd = OMD->getBody()->getLocStart();
@@ -585,12 +585,12 @@
ResultStr.c_str(), ResultStr.size());
}
- for (ObjcCategoryImplDecl::classmeth_iterator
+ for (ObjCCategoryImplDecl::classmeth_iterator
I = IMD ? IMD->classmeth_begin() : CID->classmeth_begin(),
E = IMD ? IMD->classmeth_end() : CID->classmeth_end(); I != E; ++I) {
std::string ResultStr;
- ObjcMethodDecl *OMD = *I;
- RewriteObjcMethodDecl(OMD, ResultStr);
+ ObjCMethodDecl *OMD = *I;
+ RewriteObjCMethodDecl(OMD, ResultStr);
SourceLocation LocStart = OMD->getLocStart();
SourceLocation LocEnd = OMD->getBody()->getLocStart();
@@ -605,9 +605,9 @@
Rewrite.InsertText(CID->getLocEnd(), "// ", 3);
}
-void RewriteTest::RewriteInterfaceDecl(ObjcInterfaceDecl *ClassDecl) {
+void RewriteTest::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) {
std::string ResultStr;
- if (!ObjcForwardDecls.count(ClassDecl)) {
+ if (!ObjCForwardDecls.count(ClassDecl)) {
// we haven't seen a forward decl - generate a typedef.
ResultStr = "#ifndef _REWRITER_typedef_";
ResultStr += ClassDecl->getName();
@@ -622,16 +622,16 @@
ResultStr += ";\n#endif\n";
// Mark this typedef as having been generated.
- ObjcForwardDecls.insert(ClassDecl);
+ ObjCForwardDecls.insert(ClassDecl);
}
- SynthesizeObjcInternalStruct(ClassDecl, ResultStr);
+ SynthesizeObjCInternalStruct(ClassDecl, ResultStr);
RewriteProperties(ClassDecl->getNumPropertyDecl(),
ClassDecl->getPropertyDecl());
- for (ObjcInterfaceDecl::instmeth_iterator I = ClassDecl->instmeth_begin(),
+ for (ObjCInterfaceDecl::instmeth_iterator I = ClassDecl->instmeth_begin(),
E = ClassDecl->instmeth_end(); I != E; ++I)
RewriteMethodDeclaration(*I);
- for (ObjcInterfaceDecl::classmeth_iterator I = ClassDecl->classmeth_begin(),
+ for (ObjCInterfaceDecl::classmeth_iterator I = ClassDecl->classmeth_begin(),
E = ClassDecl->classmeth_end(); I != E; ++I)
RewriteMethodDeclaration(*I);
@@ -640,7 +640,7 @@
}
Stmt *RewriteTest::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
- ObjcIvarDecl *D = IV->getDecl();
+ ObjCIvarDecl *D = IV->getDecl();
if (IV->isFreeIvar()) {
Expr *Replacement = new MemberExpr(IV->getBase(), true, D,
IV->getLocation());
@@ -656,7 +656,7 @@
} else {
if (CurMethodDecl) {
if (const PointerType *pType = IV->getBase()->getType()->getAsPointerType()) {
- ObjcInterfaceType *intT = dyn_cast<ObjcInterfaceType>(pType->getPointeeType());
+ ObjCInterfaceType *intT = dyn_cast<ObjCInterfaceType>(pType->getPointeeType());
if (CurMethodDecl->getClassInterface() == intT->getDecl()) {
IdentifierInfo *II = intT->getDecl()->getIdentifier();
RecordDecl *RD = new RecordDecl(Decl::Struct, SourceLocation(),
@@ -729,11 +729,11 @@
return RewriteMessageExpr(MessExpr);
}
- if (ObjcAtTryStmt *StmtTry = dyn_cast<ObjcAtTryStmt>(S))
- return RewriteObjcTryStmt(StmtTry);
+ if (ObjCAtTryStmt *StmtTry = dyn_cast<ObjCAtTryStmt>(S))
+ return RewriteObjCTryStmt(StmtTry);
- if (ObjcAtThrowStmt *StmtThrow = dyn_cast<ObjcAtThrowStmt>(S))
- return RewriteObjcThrowStmt(StmtThrow);
+ if (ObjCAtThrowStmt *StmtThrow = dyn_cast<ObjCAtThrowStmt>(S))
+ return RewriteObjCThrowStmt(StmtThrow);
if (ObjCProtocolExpr *ProtocolExp = dyn_cast<ObjCProtocolExpr>(S))
return RewriteObjCProtocolExpr(ProtocolExp);
@@ -755,7 +755,7 @@
return S;
}
-Stmt *RewriteTest::RewriteObjcTryStmt(ObjcAtTryStmt *S) {
+Stmt *RewriteTest::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
// Get the start location and compute the semi location.
SourceLocation startLoc = S->getLocStart();
const char *startBuf = SM->getCharacterData(startLoc);
@@ -792,7 +792,7 @@
bool sawIdTypedCatch = false;
Stmt *lastCatchBody = 0;
- ObjcAtCatchStmt *catchList = S->getCatchStmts();
+ ObjCAtCatchStmt *catchList = S->getCatchStmts();
while (catchList) {
Stmt *catchStmt = catchList->getCatchParamStmt();
@@ -809,15 +809,15 @@
if (DeclStmt *declStmt = dyn_cast<DeclStmt>(catchStmt)) {
QualType t = dyn_cast<ValueDecl>(declStmt->getDecl())->getType();
- if (t == Context->getObjcIdType()) {
+ if (t == Context->getObjCIdType()) {
buf += "1) { ";
Rewrite.ReplaceText(startLoc, lParenLoc-startBuf+1,
buf.c_str(), buf.size());
sawIdTypedCatch = true;
} else if (const PointerType *pType = t->getAsPointerType()) {
- ObjcInterfaceType *cls; // Should be a pointer to a class.
+ ObjCInterfaceType *cls; // Should be a pointer to a class.
- cls = dyn_cast<ObjcInterfaceType>(pType->getPointeeType().getTypePtr());
+ cls = dyn_cast<ObjCInterfaceType>(pType->getPointeeType().getTypePtr());
if (cls) {
buf += "objc_exception_match((struct objc_class *)objc_getClass(\"";
buf += cls->getDecl()->getName();
@@ -858,7 +858,7 @@
// Set lastCurlyLoc
lastCurlyLoc = lastCatchBody->getLocEnd();
}
- if (ObjcAtFinallyStmt *finalStmt = S->getFinallyStmt()) {
+ if (ObjCAtFinallyStmt *finalStmt = S->getFinallyStmt()) {
startLoc = finalStmt->getLocStart();
startBuf = SM->getCharacterData(startLoc);
assert((*startBuf == '@') && "bogus @finally start");
@@ -891,18 +891,18 @@
return 0;
}
-Stmt *RewriteTest::RewriteObjcCatchStmt(ObjcAtCatchStmt *S) {
+Stmt *RewriteTest::RewriteObjCCatchStmt(ObjCAtCatchStmt *S) {
return 0;
}
-Stmt *RewriteTest::RewriteObjcFinallyStmt(ObjcAtFinallyStmt *S) {
+Stmt *RewriteTest::RewriteObjCFinallyStmt(ObjCAtFinallyStmt *S) {
return 0;
}
// This can't be done with Rewrite.ReplaceStmt(S, ThrowExpr), since
// the throw expression is typically a message expression that's already
// been rewritten! (which implies the SourceLocation's are invalid).
-Stmt *RewriteTest::RewriteObjcThrowStmt(ObjcAtThrowStmt *S) {
+Stmt *RewriteTest::RewriteObjCThrowStmt(ObjCAtThrowStmt *S) {
// Get the start location and compute the semi location.
SourceLocation startLoc = S->getLocStart();
const char *startBuf = SM->getCharacterData(startLoc);
@@ -925,7 +925,7 @@
// Create a new string expression.
QualType StrType = Context->getPointerType(Context->CharTy);
std::string StrEncoding;
- Context->getObjcEncodingForType(Exp->getEncodedType(), StrEncoding);
+ Context->getObjCEncodingForType(Exp->getEncodedType(), StrEncoding);
Expr *Replacement = new StringLiteral(StrEncoding.c_str(),
StrEncoding.length(), false, StrType,
SourceLocation(), SourceLocation());
@@ -1012,21 +1012,21 @@
bool RewriteTest::needToScanForQualifiers(QualType T) {
- if (T == Context->getObjcIdType())
+ if (T == Context->getObjCIdType())
return true;
- if (T->isObjcQualifiedIdType())
+ if (T->isObjCQualifiedIdType())
return true;
if (const PointerType *pType = T->getAsPointerType()) {
Type *pointeeType = pType->getPointeeType().getTypePtr();
- if (isa<ObjcQualifiedInterfaceType>(pointeeType))
+ if (isa<ObjCQualifiedInterfaceType>(pointeeType))
return true; // we have "Class <Protocol> *".
}
return false;
}
-void RewriteTest::RewriteObjcQualifiedInterfaceTypes(Decl *Dcl) {
+void RewriteTest::RewriteObjCQualifiedInterfaceTypes(Decl *Dcl) {
SourceLocation Loc;
QualType Type;
const FunctionTypeProto *proto = 0;
@@ -1104,7 +1104,7 @@
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
Context->CharTy.getQualifiedType(QualType::Const)));
- QualType getFuncType = Context->getFunctionType(Context->getObjcSelType(),
+ QualType getFuncType = Context->getFunctionType(Context->getObjCSelType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/);
SelGetUidFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1118,7 +1118,7 @@
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
Context->CharTy.getQualifiedType(QualType::Const)));
- QualType getFuncType = Context->getFunctionType(Context->getObjcProtoType(),
+ QualType getFuncType = Context->getFunctionType(Context->getObjCProtoType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/);
GetProtocolFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1132,20 +1132,20 @@
SelGetUidFunctionDecl = FD;
return;
}
- RewriteObjcQualifiedInterfaceTypes(FD);
+ RewriteObjCQualifiedInterfaceTypes(FD);
}
// SynthMsgSendFunctionDecl - id objc_msgSend(id self, SEL op, ...);
void RewriteTest::SynthMsgSendFunctionDecl() {
IdentifierInfo *msgSendIdent = &Context->Idents.get("objc_msgSend");
llvm::SmallVector<QualType, 16> ArgTys;
- QualType argT = Context->getObjcIdType();
+ QualType argT = Context->getObjCIdType();
assert(!argT.isNull() && "Can't find 'id' type");
ArgTys.push_back(argT);
- argT = Context->getObjcSelType();
+ argT = Context->getObjCSelType();
assert(!argT.isNull() && "Can't find 'SEL' type");
ArgTys.push_back(argT);
- QualType msgSendType = Context->getFunctionType(Context->getObjcIdType(),
+ QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/);
MsgSendFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1162,10 +1162,10 @@
QualType argT = Context->getPointerType(Context->getTagDeclType(RD));
assert(!argT.isNull() && "Can't build 'struct objc_super *' type");
ArgTys.push_back(argT);
- argT = Context->getObjcSelType();
+ argT = Context->getObjCSelType();
assert(!argT.isNull() && "Can't find 'SEL' type");
ArgTys.push_back(argT);
- QualType msgSendType = Context->getFunctionType(Context->getObjcIdType(),
+ QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/);
MsgSendSuperFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1177,13 +1177,13 @@
void RewriteTest::SynthMsgSendStretFunctionDecl() {
IdentifierInfo *msgSendIdent = &Context->Idents.get("objc_msgSend_stret");
llvm::SmallVector<QualType, 16> ArgTys;
- QualType argT = Context->getObjcIdType();
+ QualType argT = Context->getObjCIdType();
assert(!argT.isNull() && "Can't find 'id' type");
ArgTys.push_back(argT);
- argT = Context->getObjcSelType();
+ argT = Context->getObjCSelType();
assert(!argT.isNull() && "Can't find 'SEL' type");
ArgTys.push_back(argT);
- QualType msgSendType = Context->getFunctionType(Context->getObjcIdType(),
+ QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/);
MsgSendStretFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1202,10 +1202,10 @@
QualType argT = Context->getPointerType(Context->getTagDeclType(RD));
assert(!argT.isNull() && "Can't build 'struct objc_super *' type");
ArgTys.push_back(argT);
- argT = Context->getObjcSelType();
+ argT = Context->getObjCSelType();
assert(!argT.isNull() && "Can't find 'SEL' type");
ArgTys.push_back(argT);
- QualType msgSendType = Context->getFunctionType(Context->getObjcIdType(),
+ QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/);
MsgSendSuperStretFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1217,13 +1217,13 @@
void RewriteTest::SynthMsgSendFpretFunctionDecl() {
IdentifierInfo *msgSendIdent = &Context->Idents.get("objc_msgSend_fpret");
llvm::SmallVector<QualType, 16> ArgTys;
- QualType argT = Context->getObjcIdType();
+ QualType argT = Context->getObjCIdType();
assert(!argT.isNull() && "Can't find 'id' type");
ArgTys.push_back(argT);
- argT = Context->getObjcSelType();
+ argT = Context->getObjCSelType();
assert(!argT.isNull() && "Can't find 'SEL' type");
ArgTys.push_back(argT);
- QualType msgSendType = Context->getFunctionType(Context->getObjcIdType(),
+ QualType msgSendType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
true /*isVariadic*/);
MsgSendFpretFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1237,7 +1237,7 @@
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
Context->CharTy.getQualifiedType(QualType::Const)));
- QualType getClassType = Context->getFunctionType(Context->getObjcIdType(),
+ QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/);
GetClassFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1251,7 +1251,7 @@
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
Context->CharTy.getQualifiedType(QualType::Const)));
- QualType getClassType = Context->getFunctionType(Context->getObjcIdType(),
+ QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/);
GetMetaClassFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1265,7 +1265,7 @@
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
Context->CharTy.getQualifiedType(QualType::Const)));
- QualType getClassType = Context->getFunctionType(Context->getObjcIdType(),
+ QualType getClassType = Context->getFunctionType(Context->getObjCIdType(),
&ArgTys[0], ArgTys.size(),
false /*isVariadic*/);
CFStringFunctionDecl = new FunctionDecl(SourceLocation(),
@@ -1305,7 +1305,7 @@
QualType expType = Context->getPointerType(ClsRef->getType());
UnaryOperator *Unop = new UnaryOperator(ClsRef, UnaryOperator::AddrOf,
expType, SourceLocation());
- CastExpr *cast = new CastExpr(Context->getObjcClassType(), Unop,
+ CastExpr *cast = new CastExpr(Context->getObjCClassType(), Unop,
SourceLocation());
InitExprs.push_back(cast); // set the 'isa'.
InitExprs.push_back(Exp->getString()); // set "char *bytes".
@@ -1335,7 +1335,7 @@
#endif
}
-ObjcInterfaceDecl *RewriteTest::isSuperReceiver(Expr *recExpr) {
+ObjCInterfaceDecl *RewriteTest::isSuperReceiver(Expr *recExpr) {
// check if we are sending a message to 'super'
if (CurMethodDecl && CurMethodDecl->isInstance()) {
if (CastExpr *CE = dyn_cast<CastExpr>(recExpr)) {
@@ -1343,11 +1343,11 @@
if (ParmVarDecl *PVD = dyn_cast<ParmVarDecl>(DRE->getDecl())) {
if (!strcmp(PVD->getName(), "self")) {
// is this id<P1..> type?
- if (CE->getType()->isObjcQualifiedIdType())
+ if (CE->getType()->isObjCQualifiedIdType())
return 0;
if (const PointerType *PT = CE->getType()->getAsPointerType()) {
- if (ObjcInterfaceType *IT =
- dyn_cast<ObjcInterfaceType>(PT->getPointeeType())) {
+ if (ObjCInterfaceType *IT =
+ dyn_cast<ObjCInterfaceType>(PT->getPointeeType())) {
if (IT->getDecl() ==
CurMethodDecl->getClassInterface()->getSuperClass())
return IT->getDecl();
@@ -1369,9 +1369,9 @@
QualType FieldTypes[2];
// struct objc_object *receiver;
- FieldTypes[0] = Context->getObjcIdType();
+ FieldTypes[0] = Context->getObjCIdType();
// struct objc_class *super;
- FieldTypes[1] = Context->getObjcClassType();
+ FieldTypes[1] = Context->getObjCClassType();
// Create fields
FieldDecl *FieldDecls[2];
@@ -1405,7 +1405,7 @@
FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl;
// May need to use objc_msgSend_stret() as well.
FunctionDecl *MsgSendStretFlavor = 0;
- if (ObjcMethodDecl *mDecl = Exp->getMethodDecl()) {
+ if (ObjCMethodDecl *mDecl = Exp->getMethodDecl()) {
QualType resultType = mDecl->getResultType();
if (resultType.getCanonicalType()->isStructureType()
|| resultType.getCanonicalType()->isUnionType())
@@ -1426,14 +1426,14 @@
MsgSendStretFlavor = MsgSendSuperStretFunctionDecl;
assert(MsgSendFlavor && "MsgSendFlavor is NULL!");
- ObjcInterfaceDecl *SuperDecl =
+ ObjCInterfaceDecl *SuperDecl =
CurMethodDecl->getClassInterface()->getSuperClass();
llvm::SmallVector<Expr*, 4> InitExprs;
// set the receiver to self, the first argument to all methods.
InitExprs.push_back(new DeclRefExpr(CurMethodDecl->getSelfDecl(),
- Context->getObjcIdType(),
+ Context->getObjCIdType(),
SourceLocation()));
llvm::SmallVector<Expr*, 8> ClsExprs;
QualType argType = Context->getPointerType(Context->CharTy);
@@ -1446,7 +1446,7 @@
ClsExprs.size());
// To turn off a warning, type-cast to 'id'
InitExprs.push_back(
- new CastExpr(Context->getObjcIdType(),
+ new CastExpr(Context->getObjCIdType(),
Cls, SourceLocation())); // set 'super class', using objc_getClass().
// struct objc_super
QualType superType = getSuperStructType();
@@ -1476,7 +1476,7 @@
} else { // instance message.
Expr *recExpr = Exp->getReceiver();
- if (ObjcInterfaceDecl *SuperDecl = isSuperReceiver(recExpr)) {
+ if (ObjCInterfaceDecl *SuperDecl = isSuperReceiver(recExpr)) {
MsgSendFlavor = MsgSendSuperFunctionDecl;
if (MsgSendStretFlavor)
MsgSendStretFlavor = MsgSendSuperStretFunctionDecl;
@@ -1485,7 +1485,7 @@
llvm::SmallVector<Expr*, 4> InitExprs;
InitExprs.push_back(
- new CastExpr(Context->getObjcIdType(),
+ new CastExpr(Context->getObjCIdType(),
recExpr, SourceLocation())); // set the 'receiver'.
llvm::SmallVector<Expr*, 8> ClsExprs;
@@ -1499,7 +1499,7 @@
ClsExprs.size());
// To turn off a warning, type-cast to 'id'
InitExprs.push_back(
- new CastExpr(Context->getObjcIdType(),
+ new CastExpr(Context->getObjCIdType(),
Cls, SourceLocation())); // set 'super class', using objc_getClass().
// struct objc_super
QualType superType = getSuperStructType();
@@ -1519,7 +1519,7 @@
// Foo<Proto> *.
while (CastExpr *CE = dyn_cast<CastExpr>(recExpr))
recExpr = CE->getSubExpr();
- recExpr = new CastExpr(Context->getObjcIdType(), recExpr, SourceLocation());
+ recExpr = new CastExpr(Context->getObjCIdType(), recExpr, SourceLocation());
MsgExprs.push_back(recExpr);
}
}
@@ -1540,16 +1540,16 @@
// Make all implicit casts explicit...ICE comes in handy:-)
if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(userExpr)) {
// Reuse the ICE type, it is exactly what the doctor ordered.
- userExpr = new CastExpr(ICE->getType()->isObjcQualifiedIdType()
- ? Context->getObjcIdType()
+ userExpr = new CastExpr(ICE->getType()->isObjCQualifiedIdType()
+ ? Context->getObjCIdType()
: ICE->getType(), userExpr, SourceLocation());
}
// Make id<P...> cast into an 'id' cast.
else if (CastExpr *CE = dyn_cast<CastExpr>(userExpr)) {
- if (CE->getType()->isObjcQualifiedIdType()) {
+ if (CE->getType()->isObjCQualifiedIdType()) {
while ((CE = dyn_cast<CastExpr>(userExpr)))
userExpr = CE->getSubExpr();
- userExpr = new CastExpr(Context->getObjcIdType(),
+ userExpr = new CastExpr(Context->getObjCIdType(),
userExpr, SourceLocation());
}
}
@@ -1567,20 +1567,20 @@
if (MsgSendFlavor == MsgSendSuperFunctionDecl)
ArgTypes.push_back(Context->getPointerType(getSuperStructType()));
else
- ArgTypes.push_back(Context->getObjcIdType());
- ArgTypes.push_back(Context->getObjcSelType());
- if (ObjcMethodDecl *mDecl = Exp->getMethodDecl()) {
+ ArgTypes.push_back(Context->getObjCIdType());
+ ArgTypes.push_back(Context->getObjCSelType());
+ if (ObjCMethodDecl *mDecl = Exp->getMethodDecl()) {
// Push any user argument types.
for (int i = 0; i < mDecl->getNumParams(); i++) {
- QualType t = mDecl->getParamDecl(i)->getType()->isObjcQualifiedIdType()
- ? Context->getObjcIdType()
+ QualType t = mDecl->getParamDecl(i)->getType()->isObjCQualifiedIdType()
+ ? Context->getObjCIdType()
: mDecl->getParamDecl(i)->getType();
ArgTypes.push_back(t);
}
- returnType = mDecl->getResultType()->isObjcQualifiedIdType()
- ? Context->getObjcIdType() : mDecl->getResultType();
+ returnType = mDecl->getResultType()->isObjCQualifiedIdType()
+ ? Context->getObjCIdType() : mDecl->getResultType();
} else {
- returnType = Context->getObjcIdType();
+ returnType = Context->getObjCIdType();
}
// Get the type, we will need to reference it in a couple spots.
QualType msgSendType = MsgSendFlavor->getType();
@@ -1708,16 +1708,16 @@
}
-/// SynthesizeObjcInternalStruct - Rewrite one internal struct corresponding to
+/// SynthesizeObjCInternalStruct - Rewrite one internal struct corresponding to
/// an objective-c class with ivars.
-void RewriteTest::SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl,
+void RewriteTest::SynthesizeObjCInternalStruct(ObjCInterfaceDecl *CDecl,
std::string &Result) {
- assert(CDecl && "Class missing in SynthesizeObjcInternalStruct");
- assert(CDecl->getName() && "Name missing in SynthesizeObjcInternalStruct");
+ assert(CDecl && "Class missing in SynthesizeObjCInternalStruct");
+ assert(CDecl->getName() && "Name missing in SynthesizeObjCInternalStruct");
// Do not synthesize more than once.
- if (ObjcSynthesizedStructs.count(CDecl))
+ if (ObjCSynthesizedStructs.count(CDecl))
return;
- ObjcInterfaceDecl *RCDecl = CDecl->getSuperClass();
+ ObjCInterfaceDecl *RCDecl = CDecl->getSuperClass();
int NumIvars = CDecl->getNumInstanceVariables();
SourceLocation LocStart = CDecl->getLocStart();
SourceLocation LocEnd = CDecl->getLocEnd();
@@ -1726,7 +1726,7 @@
const char *endBuf = SM->getCharacterData(LocEnd);
// If no ivars and no root or if its root, directly or indirectly,
// have no ivars (thus not synthesized) then no need to synthesize this class.
- if (NumIvars <= 0 && (!RCDecl || !ObjcSynthesizedStructs.count(RCDecl))) {
+ if (NumIvars <= 0 && (!RCDecl || !ObjCSynthesizedStructs.count(RCDecl))) {
endBuf += Lexer::MeasureTokenLength(LocEnd, *SM);
Rewrite.ReplaceText(LocStart, endBuf-startBuf,
Result.c_str(), Result.size());
@@ -1734,19 +1734,19 @@
}
// FIXME: This has potential of causing problem. If
- // SynthesizeObjcInternalStruct is ever called recursively.
+ // SynthesizeObjCInternalStruct is ever called recursively.
Result += "\nstruct ";
Result += CDecl->getName();
if (NumIvars > 0) {
const char *cursor = strchr(startBuf, '{');
assert((cursor && endBuf)
- && "SynthesizeObjcInternalStruct - malformed @interface");
+ && "SynthesizeObjCInternalStruct - malformed @interface");
// rewrite the original header *without* disturbing the '{'
Rewrite.ReplaceText(LocStart, cursor-startBuf-1,
Result.c_str(), Result.size());
- if (RCDecl && ObjcSynthesizedStructs.count(RCDecl)) {
+ if (RCDecl && ObjCSynthesizedStructs.count(RCDecl)) {
Result = "\n struct ";
Result += RCDecl->getName();
// Note: We don't name the field decl. This simplifies the "codegen" for
@@ -1806,13 +1806,13 @@
Result.c_str(), Result.size());
}
// Mark this struct as having been generated.
- if (!ObjcSynthesizedStructs.insert(CDecl))
- assert(false && "struct already synthesize- SynthesizeObjcInternalStruct");
+ if (!ObjCSynthesizedStructs.insert(CDecl))
+ assert(false && "struct already synthesize- SynthesizeObjCInternalStruct");
}
-// RewriteObjcMethodsMetaData - Rewrite methods metadata for instance or
+// RewriteObjCMethodsMetaData - Rewrite methods metadata for instance or
/// class methods.
-void RewriteTest::RewriteObjcMethodsMetaData(instmeth_iterator MethodBegin,
+void RewriteTest::RewriteObjCMethodsMetaData(instmeth_iterator MethodBegin,
instmeth_iterator MethodEnd,
bool IsInstanceMethod,
const char *prefix,
@@ -1861,7 +1861,7 @@
Result += "\t,{{(SEL)\"";
Result += (*MethodBegin)->getSelector().getName().c_str();
std::string MethodTypeString;
- Context->getObjcEncodingForMethodDecl(*MethodBegin, MethodTypeString);
+ Context->getObjCEncodingForMethodDecl(*MethodBegin, MethodTypeString);
Result += "\", \"";
Result += MethodTypeString;
Result += "\", ";
@@ -1871,7 +1871,7 @@
Result += "\t ,{(SEL)\"";
Result += (*MethodBegin)->getSelector().getName().c_str();
std::string MethodTypeString;
- Context->getObjcEncodingForMethodDecl(*MethodBegin, MethodTypeString);
+ Context->getObjCEncodingForMethodDecl(*MethodBegin, MethodTypeString);
Result += "\", \"";
Result += MethodTypeString;
Result += "\", ";
@@ -1881,8 +1881,8 @@
Result += "\t }\n};\n";
}
-/// RewriteObjcProtocolsMetaData - Rewrite protocols meta-data.
-void RewriteTest::RewriteObjcProtocolsMetaData(ObjcProtocolDecl **Protocols,
+/// RewriteObjCProtocolsMetaData - Rewrite protocols meta-data.
+void RewriteTest::RewriteObjCProtocolsMetaData(ObjCProtocolDecl **Protocols,
int NumProtocols,
const char *prefix,
const char *ClassName,
@@ -1890,7 +1890,7 @@
static bool objc_protocol_methods = false;
if (NumProtocols > 0) {
for (int i = 0; i < NumProtocols; i++) {
- ObjcProtocolDecl *PDecl = Protocols[i];
+ ObjCProtocolDecl *PDecl = Protocols[i];
// Output struct protocol_methods holder of method selector and type.
if (!objc_protocol_methods &&
(PDecl->getNumInstanceMethods() > 0
@@ -1925,7 +1925,7 @@
"{\n\t" + utostr(NumMethods) + "\n";
// Output instance methods declared in this protocol.
- for (ObjcProtocolDecl::instmeth_iterator I = PDecl->instmeth_begin(),
+ for (ObjCProtocolDecl::instmeth_iterator I = PDecl->instmeth_begin(),
E = PDecl->instmeth_end(); I != E; ++I) {
if (I == PDecl->instmeth_begin())
Result += "\t ,{{(SEL)\"";
@@ -1933,7 +1933,7 @@
Result += "\t ,{(SEL)\"";
Result += (*I)->getSelector().getName().c_str();
std::string MethodTypeString;
- Context->getObjcEncodingForMethodDecl((*I), MethodTypeString);
+ Context->getObjCEncodingForMethodDecl((*I), MethodTypeString);
Result += "\", \"";
Result += MethodTypeString;
Result += "\"}\n";
@@ -1953,7 +1953,7 @@
Result += "\n";
// Output instance methods declared in this protocol.
- for (ObjcProtocolDecl::classmeth_iterator I = PDecl->classmeth_begin(),
+ for (ObjCProtocolDecl::classmeth_iterator I = PDecl->classmeth_begin(),
E = PDecl->classmeth_end(); I != E; ++I) {
if (I == PDecl->classmeth_begin())
Result += "\t ,{{(SEL)\"";
@@ -1961,7 +1961,7 @@
Result += "\t ,{(SEL)\"";
Result += (*I)->getSelector().getName().c_str();
std::string MethodTypeString;
- Context->getObjcEncodingForMethodDecl((*I), MethodTypeString);
+ Context->getObjCEncodingForMethodDecl((*I), MethodTypeString);
Result += "\", \"";
Result += MethodTypeString;
Result += "\"}\n";
@@ -2039,7 +2039,7 @@
Result += " \n";
for (int i = 1; i < NumProtocols; i++) {
- ObjcProtocolDecl *PDecl = Protocols[i];
+ ObjCProtocolDecl *PDecl = Protocols[i];
Result += "\t ,&_OBJC_PROTOCOL_";
Result += PDecl->getName();
Result += "\n";
@@ -2048,13 +2048,13 @@
}
}
-/// RewriteObjcCategoryImplDecl - Rewrite metadata for each category
+/// RewriteObjCCategoryImplDecl - Rewrite metadata for each category
/// implementation.
-void RewriteTest::RewriteObjcCategoryImplDecl(ObjcCategoryImplDecl *IDecl,
+void RewriteTest::RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *IDecl,
std::string &Result) {
- ObjcInterfaceDecl *ClassDecl = IDecl->getClassInterface();
+ ObjCInterfaceDecl *ClassDecl = IDecl->getClassInterface();
// Find category declaration for this implementation.
- ObjcCategoryDecl *CDecl;
+ ObjCCategoryDecl *CDecl;
for (CDecl = ClassDecl->getCategoryList(); CDecl;
CDecl = CDecl->getNextClassCategory())
if (CDecl->getIdentifier() == IDecl->getIdentifier())
@@ -2065,19 +2065,19 @@
FullCategoryName += IDecl->getName();
// Build _objc_method_list for class's instance methods if needed
- RewriteObjcMethodsMetaData(IDecl->instmeth_begin(), IDecl->instmeth_end(),
+ RewriteObjCMethodsMetaData(IDecl->instmeth_begin(), IDecl->instmeth_end(),
true, "CATEGORY_", FullCategoryName.c_str(),
Result);
// Build _objc_method_list for class's class methods if needed
- RewriteObjcMethodsMetaData(IDecl->classmeth_begin(), IDecl->classmeth_end(),
+ RewriteObjCMethodsMetaData(IDecl->classmeth_begin(), IDecl->classmeth_end(),
false, "CATEGORY_", FullCategoryName.c_str(),
Result);
// Protocols referenced in class declaration?
// Null CDecl is case of a category implementation with no category interface
if (CDecl)
- RewriteObjcProtocolsMetaData(CDecl->getReferencedProtocols(),
+ RewriteObjCProtocolsMetaData(CDecl->getReferencedProtocols(),
CDecl->getNumReferencedProtocols(),
"CATEGORY",
FullCategoryName.c_str(), Result);
@@ -2145,8 +2145,8 @@
/// SynthesizeIvarOffsetComputation - This rutine synthesizes computation of
/// ivar offset.
-void RewriteTest::SynthesizeIvarOffsetComputation(ObjcImplementationDecl *IDecl,
- ObjcIvarDecl *ivar,
+void RewriteTest::SynthesizeIvarOffsetComputation(ObjCImplementationDecl *IDecl,
+ ObjCIvarDecl *ivar,
std::string &Result) {
Result += "offsetof(struct ";
Result += IDecl->getName();
@@ -2159,15 +2159,15 @@
// Meta Data Emission
//===----------------------------------------------------------------------===//
-void RewriteTest::RewriteObjcClassMetaData(ObjcImplementationDecl *IDecl,
+void RewriteTest::RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl,
std::string &Result) {
- ObjcInterfaceDecl *CDecl = IDecl->getClassInterface();
+ ObjCInterfaceDecl *CDecl = IDecl->getClassInterface();
// Explictly declared @interface's are already synthesized.
if (CDecl->ImplicitInterfaceDecl()) {
// FIXME: Implementation of a class with no @interface (legacy) doese not
// produce correct synthesis as yet.
- SynthesizeObjcInternalStruct(CDecl, Result);
+ SynthesizeObjCInternalStruct(CDecl, Result);
}
// Build _objc_ivar_list metadata for classes ivars if needed
@@ -2207,7 +2207,7 @@
Result += utostr(NumIvars);
Result += "\n";
- ObjcInterfaceDecl::ivar_iterator IVI, IVE;
+ ObjCInterfaceDecl::ivar_iterator IVI, IVE;
if (IDecl->getImplDeclNumIvars() > 0) {
IVI = IDecl->ivar_begin();
IVE = IDecl->ivar_end();
@@ -2219,7 +2219,7 @@
Result += (*IVI)->getName();
Result += "\", \"";
std::string StrEncoding;
- Context->getObjcEncodingForType((*IVI)->getType(), StrEncoding);
+ Context->getObjCEncodingForType((*IVI)->getType(), StrEncoding);
Result += StrEncoding;
Result += "\", ";
SynthesizeIvarOffsetComputation(IDecl, *IVI, Result);
@@ -2229,7 +2229,7 @@
Result += (*IVI)->getName();
Result += "\", \"";
std::string StrEncoding;
- Context->getObjcEncodingForType((*IVI)->getType(), StrEncoding);
+ Context->getObjCEncodingForType((*IVI)->getType(), StrEncoding);
Result += StrEncoding;
Result += "\", ";
SynthesizeIvarOffsetComputation(IDecl, (*IVI), Result);
@@ -2240,15 +2240,15 @@
}
// Build _objc_method_list for class's instance methods if needed
- RewriteObjcMethodsMetaData(IDecl->instmeth_begin(), IDecl->instmeth_end(),
+ RewriteObjCMethodsMetaData(IDecl->instmeth_begin(), IDecl->instmeth_end(),
true, "", IDecl->getName(), Result);
// Build _objc_method_list for class's class methods if needed
- RewriteObjcMethodsMetaData(IDecl->classmeth_begin(), IDecl->classmeth_end(),
+ RewriteObjCMethodsMetaData(IDecl->classmeth_begin(), IDecl->classmeth_end(),
false, "", IDecl->getName(), Result);
// Protocols referenced in class declaration?
- RewriteObjcProtocolsMetaData(CDecl->getReferencedProtocols(),
+ RewriteObjCProtocolsMetaData(CDecl->getReferencedProtocols(),
CDecl->getNumIntfRefProtocols(),
"CLASS", CDecl->getName(), Result);
@@ -2289,8 +2289,8 @@
}
// Meta-class metadata generation.
- ObjcInterfaceDecl *RootClass = 0;
- ObjcInterfaceDecl *SuperClass = CDecl->getSuperClass();
+ ObjCInterfaceDecl *RootClass = 0;
+ ObjCInterfaceDecl *SuperClass = CDecl->getSuperClass();
while (SuperClass) {
RootClass = SuperClass;
SuperClass = SuperClass->getSuperClass();
@@ -2316,7 +2316,7 @@
Result += CDecl->getName();
Result += "\"";
}
- // Set 'ivars' field for root class to 0. Objc1 runtime does not use it.
+ // Set 'ivars' field for root class to 0. ObjC1 runtime does not use it.
// 'info' field is initialized to CLS_META(2) for metaclass
Result += ", 0,2, sizeof(struct _objc_class), 0";
if (IDecl->getNumClassMethods() > 0) {
@@ -2355,7 +2355,7 @@
}
// 'info' field is initialized to CLS_CLASS(1) for class
Result += ", 0,1";
- if (!ObjcSynthesizedStructs.count(CDecl))
+ if (!ObjCSynthesizedStructs.count(CDecl))
Result += ",0";
else {
// class has size. Must synthesize its size.
@@ -2408,11 +2408,11 @@
// For each implemented class, write out all its meta data.
for (int i = 0; i < ClsDefCount; i++)
- RewriteObjcClassMetaData(ClassImplementation[i], Result);
+ RewriteObjCClassMetaData(ClassImplementation[i], Result);
// For each implemented category, write out all its meta data.
for (int i = 0; i < CatDefCount; i++)
- RewriteObjcCategoryImplDecl(CategoryImplementation[i], Result);
+ RewriteObjCCategoryImplDecl(CategoryImplementation[i], Result);
// Write objc_symtab metadata
/*
Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Mon Jan 7 13:49:32 2008
@@ -1,4 +1,4 @@
-//===--- ParseObjc.cpp - Objective C Parsing ------------------------------===//
+//===--- ParseObjC.cpp - Objective C Parsing ------------------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -298,20 +298,20 @@
/// copy
/// nonatomic
///
-void Parser::ParseObjCPropertyAttribute (ObjcDeclSpec &DS) {
+void Parser::ParseObjCPropertyAttribute (ObjCDeclSpec &DS) {
SourceLocation loc = ConsumeParen(); // consume '('
while (isObjCPropertyAttribute()) {
const IdentifierInfo *II = Tok.getIdentifierInfo();
// getter/setter require extra treatment.
- if (II == ObjcPropertyAttrs[objc_getter] ||
- II == ObjcPropertyAttrs[objc_setter]) {
+ if (II == ObjCPropertyAttrs[objc_getter] ||
+ II == ObjCPropertyAttrs[objc_setter]) {
// skip getter/setter part.
SourceLocation loc = ConsumeToken();
if (Tok.is(tok::equal)) {
loc = ConsumeToken();
if (Tok.is(tok::identifier)) {
- if (II == ObjcPropertyAttrs[objc_setter]) {
- DS.setPropertyAttributes(ObjcDeclSpec::DQ_PR_setter);
+ if (II == ObjCPropertyAttrs[objc_setter]) {
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_setter);
DS.setSetterName(Tok.getIdentifierInfo());
loc = ConsumeToken(); // consume method name
if (Tok.isNot(tok::colon)) {
@@ -321,7 +321,7 @@
}
}
else {
- DS.setPropertyAttributes(ObjcDeclSpec::DQ_PR_getter);
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_getter);
DS.setGetterName(Tok.getIdentifierInfo());
}
}
@@ -338,18 +338,18 @@
}
}
- else if (II == ObjcPropertyAttrs[objc_readonly])
- DS.setPropertyAttributes(ObjcDeclSpec::DQ_PR_readonly);
- else if (II == ObjcPropertyAttrs[objc_assign])
- DS.setPropertyAttributes(ObjcDeclSpec::DQ_PR_assign);
- else if (II == ObjcPropertyAttrs[objc_readwrite])
- DS.setPropertyAttributes(ObjcDeclSpec::DQ_PR_readwrite);
- else if (II == ObjcPropertyAttrs[objc_retain])
- DS.setPropertyAttributes(ObjcDeclSpec::DQ_PR_retain);
- else if (II == ObjcPropertyAttrs[objc_copy])
- DS.setPropertyAttributes(ObjcDeclSpec::DQ_PR_copy);
- else if (II == ObjcPropertyAttrs[objc_nonatomic])
- DS.setPropertyAttributes(ObjcDeclSpec::DQ_PR_nonatomic);
+ else if (II == ObjCPropertyAttrs[objc_readonly])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_readonly);
+ else if (II == ObjCPropertyAttrs[objc_assign])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_assign);
+ else if (II == ObjCPropertyAttrs[objc_readwrite])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_readwrite);
+ else if (II == ObjCPropertyAttrs[objc_retain])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_retain);
+ else if (II == ObjCPropertyAttrs[objc_copy])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_copy);
+ else if (II == ObjCPropertyAttrs[objc_nonatomic])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nonatomic);
ConsumeToken(); // consume last attribute token
if (Tok.is(tok::comma)) {
@@ -378,7 +378,7 @@
SourceLocation AtLoc) {
assert(Tok.isObjCAtKeyword(tok::objc_property) &&
"ParseObjCPropertyDecl(): Expected @property");
- ObjcDeclSpec DS;
+ ObjCDeclSpec DS;
ConsumeToken(); // the "property" identifier
// Parse property attribute list, if any.
if (Tok.is(tok::l_paren)) {
@@ -394,7 +394,7 @@
Diag(Tok, diag::err_expected_semi_decl_list);
SkipUntil(tok::r_brace, true, true);
}
- return Actions.ActOnAddObjcProperties(AtLoc,
+ return Actions.ActOnAddObjCProperties(AtLoc,
&PropertyDecls[0], PropertyDecls.size(), DS);
}
@@ -486,7 +486,7 @@
if (Tok.is(tok::identifier)) {
const IdentifierInfo *II = Tok.getIdentifierInfo();
for (unsigned i = 0; i < objc_NumAttrs; ++i)
- if (II == ObjcPropertyAttrs[i]) return true;
+ if (II == ObjCPropertyAttrs[i]) return true;
}
return false;
}
@@ -501,7 +501,7 @@
Tok.getIdentifierInfo() == ObjCForCollectionInKW);
}
-/// ParseObjcTypeQualifierList - This routine parses the objective-c's type
+/// ParseObjCTypeQualifierList - This routine parses the objective-c's type
/// qualifier list and builds their bitmask representation in the input
/// argument.
///
@@ -509,27 +509,27 @@
/// objc-type-qualifier
/// objc-type-qualifiers objc-type-qualifier
///
-void Parser::ParseObjcTypeQualifierList(ObjcDeclSpec &DS) {
+void Parser::ParseObjCTypeQualifierList(ObjCDeclSpec &DS) {
while (1) {
if (Tok.isNot(tok::identifier))
return;
const IdentifierInfo *II = Tok.getIdentifierInfo();
for (unsigned i = 0; i != objc_NumQuals; ++i) {
- if (II != ObjcTypeQuals[i])
+ if (II != ObjCTypeQuals[i])
continue;
- ObjcDeclSpec::ObjcDeclQualifier Qual;
+ ObjCDeclSpec::ObjCDeclQualifier Qual;
switch (i) {
default: assert(0 && "Unknown decl qualifier");
- case objc_in: Qual = ObjcDeclSpec::DQ_In; break;
- case objc_out: Qual = ObjcDeclSpec::DQ_Out; break;
- case objc_inout: Qual = ObjcDeclSpec::DQ_Inout; break;
- case objc_oneway: Qual = ObjcDeclSpec::DQ_Oneway; break;
- case objc_bycopy: Qual = ObjcDeclSpec::DQ_Bycopy; break;
- case objc_byref: Qual = ObjcDeclSpec::DQ_Byref; break;
+ case objc_in: Qual = ObjCDeclSpec::DQ_In; break;
+ case objc_out: Qual = ObjCDeclSpec::DQ_Out; break;
+ case objc_inout: Qual = ObjCDeclSpec::DQ_Inout; break;
+ case objc_oneway: Qual = ObjCDeclSpec::DQ_Oneway; break;
+ case objc_bycopy: Qual = ObjCDeclSpec::DQ_Bycopy; break;
+ case objc_byref: Qual = ObjCDeclSpec::DQ_Byref; break;
}
- DS.setObjcDeclQualifier(Qual);
+ DS.setObjCDeclQualifier(Qual);
ConsumeToken();
II = 0;
break;
@@ -544,14 +544,14 @@
/// '(' objc-type-qualifiers[opt] type-name ')'
/// '(' objc-type-qualifiers[opt] ')'
///
-Parser::TypeTy *Parser::ParseObjCTypeName(ObjcDeclSpec &DS) {
+Parser::TypeTy *Parser::ParseObjCTypeName(ObjCDeclSpec &DS) {
assert(Tok.is(tok::l_paren) && "expected (");
SourceLocation LParenLoc = ConsumeParen(), RParenLoc;
TypeTy *Ty = 0;
// Parse type qualifiers, in, inout, etc.
- ParseObjcTypeQualifierList(DS);
+ ParseObjCTypeQualifierList(DS);
if (isTypeSpecifierQualifier()) {
Ty = ParseTypeName();
@@ -601,7 +601,7 @@
{
// Parse the return type.
TypeTy *ReturnType = 0;
- ObjcDeclSpec DSRet;
+ ObjCDeclSpec DSRet;
if (Tok.is(tok::l_paren))
ReturnType = ParseObjCTypeName(DSRet);
SourceLocation selLoc;
@@ -626,7 +626,7 @@
llvm::SmallVector<IdentifierInfo *, 12> KeyIdents;
llvm::SmallVector<Action::TypeTy *, 12> KeyTypes;
- llvm::SmallVector<ObjcDeclSpec, 12> ArgTypeQuals;
+ llvm::SmallVector<ObjCDeclSpec, 12> ArgTypeQuals;
llvm::SmallVector<IdentifierInfo *, 12> ArgNames;
Action::TypeTy *TypeInfo;
@@ -639,7 +639,7 @@
break;
}
ConsumeToken(); // Eat the ':'.
- ObjcDeclSpec DSType;
+ ObjCDeclSpec DSType;
if (Tok.is(tok::l_paren)) { // Parse the argument type.
TypeInfo = ParseObjCTypeName(DSType);
}
@@ -960,7 +960,7 @@
DeclTy *ImplCatType = Actions.ActOnStartCategoryImplementation(
atLoc, nameId, nameLoc, categoryId,
categoryLoc);
- ObjcImpDecl = ImplCatType;
+ ObjCImpDecl = ImplCatType;
return 0;
}
// We have a class implementation
@@ -982,7 +982,7 @@
if (Tok.is(tok::l_brace)) // we have ivars
ParseObjCClassInstanceVariables(ImplClsType/*FIXME*/, atLoc);
- ObjcImpDecl = ImplClsType;
+ ObjCImpDecl = ImplClsType;
return 0;
}
@@ -991,14 +991,14 @@
assert(Tok.isObjCAtKeyword(tok::objc_end) &&
"ParseObjCAtEndDeclaration(): Expected @end");
ConsumeToken(); // the "end" identifier
- if (ObjcImpDecl) {
+ if (ObjCImpDecl) {
// Checking is not necessary except that a parse error might have caused
- // @implementation not to have been parsed to completion and ObjcImpDecl
+ // @implementation not to have been parsed to completion and ObjCImpDecl
// could be 0.
- Actions.ActOnAtEnd(atLoc, ObjcImpDecl);
+ Actions.ActOnAtEnd(atLoc, ObjCImpDecl);
}
- return ObjcImpDecl;
+ return ObjCImpDecl;
}
/// compatibility-alias-decl:
@@ -1109,7 +1109,7 @@
}
}
ConsumeToken(); // consume ';'
- return Actions.ActOnObjcAtThrowStmt(atLoc, Res.Val);
+ return Actions.ActOnObjCAtThrowStmt(atLoc, Res.Val);
}
/// objc-try-catch-statement:
@@ -1160,7 +1160,7 @@
StmtResult CatchBody = ParseCompoundStatementBody();
if (CatchBody.isInvalid)
CatchBody = Actions.ActOnNullStmt(Tok.getLocation());
- CatchStmts = Actions.ActOnObjcAtCatchStmt(AtCatchFinallyLoc, RParenLoc,
+ CatchStmts = Actions.ActOnObjCAtCatchStmt(AtCatchFinallyLoc, RParenLoc,
FirstPart, CatchBody.Val, CatchStmts.Val);
ExitScope();
}
@@ -1176,7 +1176,7 @@
StmtResult FinallyBody = ParseCompoundStatementBody();
if (FinallyBody.isInvalid)
FinallyBody = Actions.ActOnNullStmt(Tok.getLocation());
- FinallyStmt = Actions.ActOnObjcAtFinallyStmt(AtCatchFinallyLoc,
+ FinallyStmt = Actions.ActOnObjCAtFinallyStmt(AtCatchFinallyLoc,
FinallyBody.Val);
catch_or_finally_seen = true;
break;
@@ -1186,14 +1186,14 @@
Diag(atLoc, diag::err_missing_catch_finally);
return true;
}
- return Actions.ActOnObjcAtTryStmt(atLoc, TryBody.Val, CatchStmts.Val,
+ return Actions.ActOnObjCAtTryStmt(atLoc, TryBody.Val, CatchStmts.Val,
FinallyStmt.Val);
}
/// objc-method-def: objc-method-proto ';'[opt] '{' body '}'
///
Parser::DeclTy *Parser::ParseObjCMethodDefinition() {
- DeclTy *MDecl = ParseObjCMethodPrototype(ObjcImpDecl);
+ DeclTy *MDecl = ParseObjCMethodPrototype(ObjCImpDecl);
// parse optional ';'
if (Tok.is(tok::semi))
ConsumeToken();
@@ -1216,7 +1216,7 @@
// Tell the actions module that we have entered a method definition with the
// specified Declarator for the method.
- Actions.ObjcActOnStartOfMethodDef(CurScope, MDecl);
+ Actions.ObjCActOnStartOfMethodDef(CurScope, MDecl);
StmtResult FnBody = ParseCompoundStatementBody();
Modified: cfe/trunk/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseStmt.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/Parse/ParseStmt.cpp Mon Jan 7 13:49:32 2008
@@ -846,7 +846,7 @@
return Actions.ActOnForStmt(ForLoc, LParenLoc, FirstPart,
SecondPart, ThirdPart, RParenLoc, Body.Val);
else
- return Actions.ActOnObjcForCollectionStmt(ForLoc, LParenLoc, FirstPart,
+ return Actions.ActOnObjCForCollectionStmt(ForLoc, LParenLoc, FirstPart,
SecondPart, RParenLoc, Body.Val);
}
Modified: cfe/trunk/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/Parser.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Parse/Parser.cpp (original)
+++ cfe/trunk/Parse/Parser.cpp Mon Jan 7 13:49:32 2008
@@ -22,7 +22,7 @@
CurScope = 0;
NumCachedScopes = 0;
ParenCount = BracketCount = BraceCount = 0;
- ObjcImpDecl = 0;
+ ObjCImpDecl = 0;
}
/// Out-of-line virtual destructor to provide home for Action class.
@@ -234,25 +234,25 @@
Diag(Tok, diag::ext_empty_source_file);
// Initialization for Objective-C context sensitive keywords recognition.
- // Referenced in Parser::ParseObjcTypeQualifierList.
+ // Referenced in Parser::ParseObjCTypeQualifierList.
if (getLang().ObjC1) {
- ObjcTypeQuals[objc_in] = &PP.getIdentifierTable().get("in");
- ObjcTypeQuals[objc_out] = &PP.getIdentifierTable().get("out");
- ObjcTypeQuals[objc_inout] = &PP.getIdentifierTable().get("inout");
- ObjcTypeQuals[objc_oneway] = &PP.getIdentifierTable().get("oneway");
- ObjcTypeQuals[objc_bycopy] = &PP.getIdentifierTable().get("bycopy");
- ObjcTypeQuals[objc_byref] = &PP.getIdentifierTable().get("byref");
+ ObjCTypeQuals[objc_in] = &PP.getIdentifierTable().get("in");
+ ObjCTypeQuals[objc_out] = &PP.getIdentifierTable().get("out");
+ ObjCTypeQuals[objc_inout] = &PP.getIdentifierTable().get("inout");
+ ObjCTypeQuals[objc_oneway] = &PP.getIdentifierTable().get("oneway");
+ ObjCTypeQuals[objc_bycopy] = &PP.getIdentifierTable().get("bycopy");
+ ObjCTypeQuals[objc_byref] = &PP.getIdentifierTable().get("byref");
}
if (getLang().ObjC2) {
- ObjcPropertyAttrs[objc_readonly] = &PP.getIdentifierTable().get("readonly");
- ObjcPropertyAttrs[objc_getter] = &PP.getIdentifierTable().get("getter");
- ObjcPropertyAttrs[objc_setter] = &PP.getIdentifierTable().get("setter");
- ObjcPropertyAttrs[objc_assign] = &PP.getIdentifierTable().get("assign");
- ObjcPropertyAttrs[objc_readwrite] =
+ ObjCPropertyAttrs[objc_readonly] = &PP.getIdentifierTable().get("readonly");
+ ObjCPropertyAttrs[objc_getter] = &PP.getIdentifierTable().get("getter");
+ ObjCPropertyAttrs[objc_setter] = &PP.getIdentifierTable().get("setter");
+ ObjCPropertyAttrs[objc_assign] = &PP.getIdentifierTable().get("assign");
+ ObjCPropertyAttrs[objc_readwrite] =
&PP.getIdentifierTable().get("readwrite");
- ObjcPropertyAttrs[objc_retain] = &PP.getIdentifierTable().get("retain");
- ObjcPropertyAttrs[objc_copy] = &PP.getIdentifierTable().get("copy");
- ObjcPropertyAttrs[objc_nonatomic] =
+ ObjCPropertyAttrs[objc_retain] = &PP.getIdentifierTable().get("retain");
+ ObjCPropertyAttrs[objc_copy] = &PP.getIdentifierTable().get("copy");
+ ObjCPropertyAttrs[objc_nonatomic] =
&PP.getIdentifierTable().get("nonatomic");
ObjCForCollectionInKW = &PP.getIdentifierTable().get("in");
}
Modified: cfe/trunk/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/Sema.cpp (original)
+++ cfe/trunk/Sema/Sema.cpp Mon Jan 7 13:49:32 2008
@@ -20,24 +20,24 @@
using namespace clang;
-bool Sema::isBuiltinObjcType(TypedefDecl *TD) {
+bool Sema::isBuiltinObjCType(TypedefDecl *TD) {
const char *typeName = TD->getIdentifier()->getName();
return strcmp(typeName, "id") == 0 || strcmp(typeName, "Class") == 0 ||
strcmp(typeName, "SEL") == 0 || strcmp(typeName, "Protocol") == 0;
}
-bool Sema::isObjcObjectPointerType(QualType type) const {
- if (!type->isPointerType() && !type->isObjcQualifiedIdType())
+bool Sema::isObjCObjectPointerType(QualType type) const {
+ if (!type->isPointerType() && !type->isObjCQualifiedIdType())
return false;
- if (type == Context.getObjcIdType() || type == Context.getObjcClassType() ||
- type->isObjcQualifiedIdType())
+ if (type == Context.getObjCIdType() || type == Context.getObjCClassType() ||
+ type->isObjCQualifiedIdType())
return true;
if (type->isPointerType()) {
PointerType *pointerType = static_cast<PointerType*>(type.getTypePtr());
type = pointerType->getPointeeType();
}
- return (type->isObjcInterfaceType() || type->isObjcQualifiedIdType());
+ return (type->isObjCInterfaceType() || type->isObjCQualifiedIdType());
}
void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
@@ -46,17 +46,17 @@
TypedefType *t;
// Add the built-in ObjC types.
- t = dyn_cast<TypedefType>(Context.getObjcIdType().getTypePtr());
+ t = dyn_cast<TypedefType>(Context.getObjCIdType().getTypePtr());
t->getDecl()->getIdentifier()->setFETokenInfo(t->getDecl());
TUScope->AddDecl(t->getDecl());
- t = dyn_cast<TypedefType>(Context.getObjcClassType().getTypePtr());
+ t = dyn_cast<TypedefType>(Context.getObjCClassType().getTypePtr());
t->getDecl()->getIdentifier()->setFETokenInfo(t->getDecl());
TUScope->AddDecl(t->getDecl());
- ObjcInterfaceType *it = dyn_cast<ObjcInterfaceType>(Context.getObjcProtoType());
- ObjcInterfaceDecl *IDecl = it->getDecl();
+ ObjCInterfaceType *it = dyn_cast<ObjCInterfaceType>(Context.getObjCProtoType());
+ ObjCInterfaceDecl *IDecl = it->getDecl();
IDecl->getIdentifier()->setFETokenInfo(IDecl);
TUScope->AddDecl(IDecl);
- t = dyn_cast<TypedefType>(Context.getObjcSelType().getTypePtr());
+ t = dyn_cast<TypedefType>(Context.getObjCSelType().getTypePtr());
t->getDecl()->getIdentifier()->setFETokenInfo(t->getDecl());
TUScope->AddDecl(t->getDecl());
}
@@ -88,24 +88,24 @@
TypedefDecl *ClassTypedef = new TypedefDecl(SourceLocation(),
&Context.Idents.get("Class"),
ClassT, 0);
- Context.setObjcClassType(ClassTypedef);
+ Context.setObjCClassType(ClassTypedef);
// Synthesize "@class Protocol;
- ObjcInterfaceDecl *ProtocolDecl = new ObjcInterfaceDecl(SourceLocation(), 0,
+ ObjCInterfaceDecl *ProtocolDecl = new ObjCInterfaceDecl(SourceLocation(), 0,
&Context.Idents.get("Protocol"), true);
- Context.setObjcProtoType(Context.getObjcInterfaceType(ProtocolDecl));
+ Context.setObjCProtoType(Context.getObjCInterfaceType(ProtocolDecl));
// Synthesize "typedef struct objc_object { Class isa; } *id;"
RecordDecl *ObjectTag = new RecordDecl(Decl::Struct, SourceLocation(),
&IT.get("objc_object"), 0);
FieldDecl *IsaDecl = new FieldDecl(SourceLocation(), 0,
- Context.getObjcClassType());
+ Context.getObjCClassType());
ObjectTag->defineBody(&IsaDecl, 1);
QualType ObjT = Context.getPointerType(Context.getTagDeclType(ObjectTag));
TypedefDecl *IdTypedef = new TypedefDecl(SourceLocation(),
&Context.Idents.get("id"),
ObjT, 0);
- Context.setObjcIdType(IdTypedef);
+ Context.setObjCIdType(IdTypedef);
// Synthesize "typedef struct objc_selector *SEL;"
RecordDecl *SelTag = new RecordDecl(Decl::Struct, SourceLocation(),
@@ -114,7 +114,7 @@
TypedefDecl *SelTypedef = new TypedefDecl(SourceLocation(),
&Context.Idents.get("SEL"),
SelT, 0);
- Context.setObjcSelType(SelTypedef);
+ Context.setObjCSelType(SelTypedef);
}
TUScope = 0;
Modified: cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/Sema.h (original)
+++ cfe/trunk/Sema/Sema.h Mon Jan 7 13:49:32 2008
@@ -48,13 +48,13 @@
class SwitchStmt;
class OCUVectorType;
class TypedefDecl;
- class ObjcInterfaceDecl;
- class ObjcProtocolDecl;
- class ObjcImplementationDecl;
- class ObjcCategoryImplDecl;
- class ObjcCategoryDecl;
- class ObjcIvarDecl;
- class ObjcMethodDecl;
+ class ObjCInterfaceDecl;
+ class ObjCProtocolDecl;
+ class ObjCImplementationDecl;
+ class ObjCCategoryImplDecl;
+ class ObjCCategoryDecl;
+ class ObjCIvarDecl;
+ class ObjCMethodDecl;
/// Sema - This implements semantic analysis and AST building for C.
class Sema : public Action {
@@ -68,7 +68,7 @@
/// CurMethodDecl - If inside of a method body, this contains a pointer to
/// the method decl for the method being parsed.
- ObjcMethodDecl *CurMethodDecl;
+ ObjCMethodDecl *CurMethodDecl;
/// LabelMap - This is a mapping from label identifiers to the LabelStmt for
/// it (which acts like the label decl in some ways). Forward referenced
@@ -82,14 +82,14 @@
/// This is only necessary for issuing pretty diagnostics.
llvm::SmallVector<TypedefDecl*, 24> OCUVectorDecls;
- /// ObjcImplementations - Keep track of all of the classes with
+ /// ObjCImplementations - Keep track of all of the classes with
/// @implementation's, so that we can emit errors on duplicates.
- llvm::DenseMap<IdentifierInfo*, ObjcImplementationDecl*> ObjcImplementations;
+ llvm::DenseMap<IdentifierInfo*, ObjCImplementationDecl*> ObjCImplementations;
- /// ObjcProtocols - Keep track of all protocol declarations declared
+ /// ObjCProtocols - Keep track of all protocol declarations declared
/// with @protocol keyword, so that we can emit errors on duplicates and
/// find the declarations when needed.
- llvm::DenseMap<IdentifierInfo*, ObjcProtocolDecl*> ObjcProtocols;
+ llvm::DenseMap<IdentifierInfo*, ObjCProtocolDecl*> ObjCProtocols;
// Enum values used by KnownFunctionIDs (see below).
enum {
@@ -118,15 +118,15 @@
Scope *TUScope;
/// ObjCMethodList - a linked list of methods with different signatures.
- struct ObjcMethodList {
- ObjcMethodDecl *Method;
- ObjcMethodList *Next;
+ struct ObjCMethodList {
+ ObjCMethodDecl *Method;
+ ObjCMethodList *Next;
- ObjcMethodList() {
+ ObjCMethodList() {
Method = 0;
Next = 0;
}
- ObjcMethodList(ObjcMethodDecl *M, ObjcMethodList *C) {
+ ObjCMethodList(ObjCMethodDecl *M, ObjCMethodList *C) {
Method = M;
Next = C;
}
@@ -135,8 +135,8 @@
/// messages to "id". We need to maintain a list, since selectors can have
/// differing signatures across classes. In Cocoa, this happens to be
/// extremely uncommon (only 1% of selectors are "overloaded").
- llvm::DenseMap<Selector, ObjcMethodList> InstanceMethodPool;
- llvm::DenseMap<Selector, ObjcMethodList> FactoryMethodPool;
+ llvm::DenseMap<Selector, ObjCMethodList> InstanceMethodPool;
+ llvm::DenseMap<Selector, ObjCMethodList> FactoryMethodPool;
public:
Sema(Preprocessor &pp, ASTContext &ctxt);
@@ -173,7 +173,7 @@
//
QualType GetTypeForDeclarator(Declarator &D, Scope *S);
- QualType ObjcGetTypeForMethodDefinition(DeclTy *D);
+ QualType ObjCGetTypeForMethodDefinition(DeclTy *D);
virtual TypeResult ActOnTypeName(Scope *S, Declarator &D);
@@ -189,7 +189,7 @@
virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group);
virtual DeclTy *ActOnStartOfFunctionDef(Scope *S, Declarator &D);
- virtual void ObjcActOnStartOfMethodDef(Scope *S, DeclTy *D);
+ virtual void ObjCActOnStartOfMethodDef(Scope *S, DeclTy *D);
virtual DeclTy *ActOnFinishFunctionBody(DeclTy *Decl, StmtTy *Body);
@@ -233,7 +233,7 @@
ScopedDecl *LookupScopedDecl(IdentifierInfo *II, unsigned NSI,
SourceLocation IdLoc, Scope *S);
ScopedDecl *LookupInterfaceDecl(IdentifierInfo *II);
- ObjcInterfaceDecl *getObjCInterfaceDecl(IdentifierInfo *Id);
+ ObjCInterfaceDecl *getObjCInterfaceDecl(IdentifierInfo *Id);
ScopedDecl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S);
ScopedDecl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
Scope *S);
@@ -257,47 +257,47 @@
/// CheckProtocolMethodDefs - This routine checks unimpletented methods
/// Declared in protocol, and those referenced by it.
- void CheckProtocolMethodDefs(ObjcProtocolDecl *PDecl,
+ void CheckProtocolMethodDefs(ObjCProtocolDecl *PDecl,
bool& IncompleteImpl,
const llvm::DenseSet<Selector> &InsMap,
const llvm::DenseSet<Selector> &ClsMap);
/// CheckImplementationIvars - This routine checks if the instance variables
/// listed in the implelementation match those listed in the interface.
- void CheckImplementationIvars(ObjcImplementationDecl *ImpDecl,
- ObjcIvarDecl **Fields, unsigned nIvars,
+ void CheckImplementationIvars(ObjCImplementationDecl *ImpDecl,
+ ObjCIvarDecl **Fields, unsigned nIvars,
SourceLocation Loc);
/// ImplMethodsVsClassMethods - This is main routine to warn if any method
/// remains unimplemented in the @implementation class.
- void ImplMethodsVsClassMethods(ObjcImplementationDecl* IMPDecl,
- ObjcInterfaceDecl* IDecl);
+ void ImplMethodsVsClassMethods(ObjCImplementationDecl* IMPDecl,
+ ObjCInterfaceDecl* IDecl);
/// ImplCategoryMethodsVsIntfMethods - Checks that methods declared in the
/// category interface is implemented in the category @implementation.
- void ImplCategoryMethodsVsIntfMethods(ObjcCategoryImplDecl *CatImplDecl,
- ObjcCategoryDecl *CatClassDecl);
+ void ImplCategoryMethodsVsIntfMethods(ObjCCategoryImplDecl *CatImplDecl,
+ ObjCCategoryDecl *CatClassDecl);
/// MatchTwoMethodDeclarations - Checks if two methods' type match and returns
/// true, or false, accordingly.
- bool MatchTwoMethodDeclarations(const ObjcMethodDecl *Method,
- const ObjcMethodDecl *PrevMethod);
+ bool MatchTwoMethodDeclarations(const ObjCMethodDecl *Method,
+ const ObjCMethodDecl *PrevMethod);
- /// isBuiltinObjcType - Returns true of the type is "id", "SEL", "Class"
+ /// isBuiltinObjCType - Returns true of the type is "id", "SEL", "Class"
/// or "Protocol".
- bool isBuiltinObjcType(TypedefDecl *TD);
+ bool isBuiltinObjCType(TypedefDecl *TD);
- /// isObjcObjectPointerType - Returns true if type is an objective-c pointer
+ /// isObjCObjectPointerType - Returns true if type is an objective-c pointer
/// to an object type; such as "id", "Class", Intf*, id<P>, etc.
- bool isObjcObjectPointerType(QualType type) const;
+ bool isObjCObjectPointerType(QualType type) const;
/// AddInstanceMethodToGlobalPool - All instance methods in a translation
/// unit are added to a global pool. This allows us to efficiently associate
/// a selector with a method declaraation for purposes of typechecking
/// messages sent to "id" (where the class of the object is unknown).
- void AddInstanceMethodToGlobalPool(ObjcMethodDecl *Method);
+ void AddInstanceMethodToGlobalPool(ObjCMethodDecl *Method);
/// AddFactoryMethodToGlobalPool - Same as above, but for factory methods.
- void AddFactoryMethodToGlobalPool(ObjcMethodDecl *Method);
+ void AddFactoryMethodToGlobalPool(ObjCMethodDecl *Method);
//===--------------------------------------------------------------------===//
// Statement Parsing Callbacks: SemaStmt.cpp.
public:
@@ -331,7 +331,7 @@
SourceLocation LParenLoc,
StmtTy *First, ExprTy *Second, ExprTy *Third,
SourceLocation RParenLoc, StmtTy *Body);
- virtual StmtResult ActOnObjcForCollectionStmt(SourceLocation ForColLoc,
+ virtual StmtResult ActOnObjCForCollectionStmt(SourceLocation ForColLoc,
SourceLocation LParenLoc,
StmtTy *First, ExprTy *Second,
SourceLocation RParenLoc, StmtTy *Body);
@@ -361,18 +361,18 @@
ExprTy **Clobbers,
SourceLocation RParenLoc);
- virtual StmtResult ActOnObjcAtCatchStmt(SourceLocation AtLoc,
+ virtual StmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
SourceLocation RParen, StmtTy *Parm,
StmtTy *Body, StmtTy *CatchList);
- virtual StmtResult ActOnObjcAtFinallyStmt(SourceLocation AtLoc,
+ virtual StmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
StmtTy *Body);
- virtual StmtResult ActOnObjcAtTryStmt(SourceLocation AtLoc,
+ virtual StmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
StmtTy *Try,
StmtTy *Catch, StmtTy *Finally);
- virtual StmtResult ActOnObjcAtThrowStmt(SourceLocation AtLoc,
+ virtual StmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
StmtTy *Throw);
//===--------------------------------------------------------------------===//
@@ -559,20 +559,20 @@
DeclTy **allMethods = 0, unsigned allNum = 0,
DeclTy **allProperties = 0, unsigned pNum = 0);
- virtual DeclTy *ActOnAddObjcProperties(SourceLocation AtLoc,
+ virtual DeclTy *ActOnAddObjCProperties(SourceLocation AtLoc,
DeclTy **allProperties,
unsigned NumProperties,
- ObjcDeclSpec &DS);
+ ObjCDeclSpec &DS);
virtual DeclTy *ActOnMethodDeclaration(
SourceLocation BeginLoc, // location of the + or -.
SourceLocation EndLoc, // location of the ; or {.
tok::TokenKind MethodType,
- DeclTy *ClassDecl, ObjcDeclSpec &ReturnQT, TypeTy *ReturnType,
+ DeclTy *ClassDecl, ObjCDeclSpec &ReturnQT, TypeTy *ReturnType,
Selector Sel,
// optional arguments. The number of types/arguments is obtained
// from the Sel.getNumArgs().
- ObjcDeclSpec *ArgQT, TypeTy **ArgTypes, IdentifierInfo **ArgNames,
+ ObjCDeclSpec *ArgQT, TypeTy **ArgTypes, IdentifierInfo **ArgNames,
AttributeList *AttrList, tok::ObjCKeywordKind MethodImplKind,
bool isVariadic = false);
@@ -746,7 +746,7 @@
// returns true if there were any incompatible arguments.
bool CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs,
- ObjcMethodDecl *Method);
+ ObjCMethodDecl *Method);
/// ConvertIntegerToTypeWarnOnOverflow - Convert the specified APInt to have
/// the specified width and sign. If an overflow occurs, detect it and emit
Modified: cfe/trunk/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaChecking.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/Sema/SemaChecking.cpp Mon Jan 7 13:49:32 2008
@@ -560,7 +560,7 @@
static DeclRefExpr* EvalAddr(Expr *E) {
// We should only be called for evaluating pointer expressions.
assert((E->getType()->isPointerType() ||
- E->getType()->isObjcQualifiedIdType()) &&
+ E->getType()->isObjCQualifiedIdType()) &&
"EvalAddr only works on pointers");
// Our "symbolic interpreter" is just a dispatch off the currently
@@ -621,7 +621,7 @@
Expr* SubExpr = IE->getSubExpr();
if (SubExpr->getType()->isPointerType() ||
- SubExpr->getType()->isObjcQualifiedIdType())
+ SubExpr->getType()->isObjCQualifiedIdType())
return EvalAddr(SubExpr);
else
return EvalVal(SubExpr);
Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Mon Jan 7 13:49:32 2008
@@ -33,10 +33,10 @@
IIDecl = cast<ScopedDecl>(IIDecl)->getNext();
if (!IIDecl)
return 0;
- if (isa<TypedefDecl>(IIDecl) || isa<ObjcInterfaceDecl>(IIDecl))
+ if (isa<TypedefDecl>(IIDecl) || isa<ObjCInterfaceDecl>(IIDecl))
return IIDecl;
- if (ObjcCompatibleAliasDecl *ADecl =
- dyn_cast<ObjcCompatibleAliasDecl>(IIDecl))
+ if (ObjCCompatibleAliasDecl *ADecl =
+ dyn_cast<ObjCCompatibleAliasDecl>(IIDecl))
return ADecl->getClassInterface();
return 0;
}
@@ -98,17 +98,17 @@
if (IDecl->getIdentifierNamespace() == Decl::IDNS_Ordinary)
break;
- if (ObjcCompatibleAliasDecl *ADecl =
- dyn_cast_or_null<ObjcCompatibleAliasDecl>(IDecl))
+ if (ObjCCompatibleAliasDecl *ADecl =
+ dyn_cast_or_null<ObjCCompatibleAliasDecl>(IDecl))
return ADecl->getClassInterface();
return IDecl;
}
-/// getObjcInterfaceDecl - Look up a for a class declaration in the scope.
+/// getObjCInterfaceDecl - Look up a for a class declaration in the scope.
/// return 0 if one not found.
-ObjcInterfaceDecl *Sema::getObjCInterfaceDecl(IdentifierInfo *Id) {
+ObjCInterfaceDecl *Sema::getObjCInterfaceDecl(IdentifierInfo *Id) {
ScopedDecl *IdDecl = LookupInterfaceDecl(Id);
- return cast_or_null<ObjcInterfaceDecl>(IdDecl);
+ return cast_or_null<ObjCInterfaceDecl>(IdDecl);
}
/// LookupScopedDecl - Look up the inner-most declaration in the specified
@@ -208,7 +208,7 @@
// Allow multiple definitions for ObjC built-in typedefs.
// FIXME: Verify the underlying types are equivalent!
- if (getLangOptions().ObjC1 && isBuiltinObjcType(New))
+ if (getLangOptions().ObjC1 && isBuiltinObjCType(New))
return Old;
// TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
@@ -697,7 +697,7 @@
}
New = NewFD;
} else {
- if (R.getTypePtr()->isObjcInterfaceType()) {
+ if (R.getTypePtr()->isObjCInterfaceType()) {
Diag(D.getIdentifierLoc(), diag::err_statically_allocated_object,
D.getIdentifier()->getName());
InvalidDecl = true;
@@ -983,7 +983,7 @@
FD->setBody((Stmt*)Body);
assert(FD == CurFunctionDecl && "Function parsing confused");
CurFunctionDecl = 0;
- } else if (ObjcMethodDecl *MD = dyn_cast<ObjcMethodDecl>(dcl)) {
+ } else if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(dcl)) {
MD->setBody((Stmt*)Body);
CurMethodDecl = 0;
}
@@ -1204,14 +1204,14 @@
if (isa<RecordDecl>(static_cast<Decl *>(TagDecl)))
NewFD = new FieldDecl(Loc, II, T, BitWidth);
- else if (isa<ObjcInterfaceDecl>(static_cast<Decl *>(TagDecl)) ||
- isa<ObjcImplementationDecl>(static_cast<Decl *>(TagDecl)) ||
- isa<ObjcCategoryDecl>(static_cast<Decl *>(TagDecl)) ||
+ else if (isa<ObjCInterfaceDecl>(static_cast<Decl *>(TagDecl)) ||
+ isa<ObjCImplementationDecl>(static_cast<Decl *>(TagDecl)) ||
+ isa<ObjCCategoryDecl>(static_cast<Decl *>(TagDecl)) ||
// FIXME: ivars are currently used to model properties, and
// properties can appear within a protocol.
- // See corresponding FIXME in DeclObjC.h:ObjcPropertyDecl.
- isa<ObjcProtocolDecl>(static_cast<Decl *>(TagDecl)))
- NewFD = new ObjcIvarDecl(Loc, II, T);
+ // See corresponding FIXME in DeclObjC.h:ObjCPropertyDecl.
+ isa<ObjCProtocolDecl>(static_cast<Decl *>(TagDecl)))
+ NewFD = new ObjCIvarDecl(Loc, II, T);
else
assert(0 && "Sema::ActOnField(): Unknown TagDecl");
@@ -1222,13 +1222,13 @@
/// TranslateIvarVisibility - Translate visibility from a token ID to an
/// AST enum value.
-static ObjcIvarDecl::AccessControl
+static ObjCIvarDecl::AccessControl
TranslateIvarVisibility(tok::ObjCKeywordKind ivarVisibility) {
switch (ivarVisibility) {
- case tok::objc_private: return ObjcIvarDecl::Private;
- case tok::objc_public: return ObjcIvarDecl::Public;
- case tok::objc_protected: return ObjcIvarDecl::Protected;
- case tok::objc_package: return ObjcIvarDecl::Package;
+ case tok::objc_private: return ObjCIvarDecl::Private;
+ case tok::objc_public: return ObjCIvarDecl::Public;
+ case tok::objc_protected: return ObjCIvarDecl::Protected;
+ case tok::objc_package: return ObjCIvarDecl::Package;
default: assert(false && "Unknown visitibility kind");
}
}
@@ -1271,7 +1271,7 @@
// If we have visibility info, make sure the AST is set accordingly.
if (visibility)
- cast<ObjcIvarDecl>(FD)->setAccessControl(
+ cast<ObjCIvarDecl>(FD)->setAccessControl(
TranslateIvarVisibility(visibility[i]));
// C99 6.7.2.1p2 - A field may not be a function type.
@@ -1337,7 +1337,7 @@
}
}
/// A field cannot be an Objective-c object
- if (FDTy->isObjcInterfaceType()) {
+ if (FDTy->isObjCInterfaceType()) {
Diag(FD->getLocation(), diag::err_statically_allocated_object,
FD->getName());
FD->setInvalidDecl();
@@ -1371,16 +1371,16 @@
if (Record)
Record->defineBody(&RecFields[0], RecFields.size());
else {
- ObjcIvarDecl **ClsFields =
- reinterpret_cast<ObjcIvarDecl**>(&RecFields[0]);
- if (isa<ObjcInterfaceDecl>(static_cast<Decl*>(RecDecl)))
- cast<ObjcInterfaceDecl>(static_cast<Decl*>(RecDecl))->
+ ObjCIvarDecl **ClsFields =
+ reinterpret_cast<ObjCIvarDecl**>(&RecFields[0]);
+ if (isa<ObjCInterfaceDecl>(static_cast<Decl*>(RecDecl)))
+ cast<ObjCInterfaceDecl>(static_cast<Decl*>(RecDecl))->
addInstanceVariablesToClass(ClsFields, RecFields.size(), RBrac);
- else if (isa<ObjcImplementationDecl>(static_cast<Decl*>(RecDecl))) {
- ObjcImplementationDecl* IMPDecl =
- cast<ObjcImplementationDecl>(static_cast<Decl*>(RecDecl));
- assert(IMPDecl && "ActOnFields - missing ObjcImplementationDecl");
- IMPDecl->ObjcAddInstanceVariablesToClassImpl(ClsFields, RecFields.size());
+ else if (isa<ObjCImplementationDecl>(static_cast<Decl*>(RecDecl))) {
+ ObjCImplementationDecl* IMPDecl =
+ cast<ObjCImplementationDecl>(static_cast<Decl*>(RecDecl));
+ assert(IMPDecl && "ActOnFields - missing ObjCImplementationDecl");
+ IMPDecl->ObjCAddInstanceVariablesToClassImpl(ClsFields, RecFields.size());
CheckImplementationIvars(IMPDecl, ClsFields, RecFields.size(), RBrac);
}
}
Modified: cfe/trunk/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDeclObjC.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/Sema/SemaDeclObjC.cpp Mon Jan 7 13:49:32 2008
@@ -18,11 +18,11 @@
using namespace clang;
-/// ObjcActOnStartOfMethodDef - This routine sets up parameters; invisible
+/// ObjCActOnStartOfMethodDef - This routine sets up parameters; invisible
/// and user declared, in the method definition's AST.
-void Sema::ObjcActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
+void Sema::ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
assert(CurFunctionDecl == 0 && "Method parsing confused");
- ObjcMethodDecl *MDecl = dyn_cast<ObjcMethodDecl>(static_cast<Decl *>(D));
+ ObjCMethodDecl *MDecl = dyn_cast<ObjCMethodDecl>(static_cast<Decl *>(D));
assert(MDecl != 0 && "Not a method declarator!");
// Allow the rest of sema to find private method decl implementations.
@@ -43,15 +43,15 @@
PI.IdentLoc = SourceLocation(); // synthesized vars have a null location.
PI.InvalidType = false;
if (MDecl->isInstance()) {
- QualType selfTy = Context.getObjcInterfaceType(MDecl->getClassInterface());
+ QualType selfTy = Context.getObjCInterfaceType(MDecl->getClassInterface());
selfTy = Context.getPointerType(selfTy);
PI.TypeInfo = selfTy.getAsOpaquePtr();
} else
- PI.TypeInfo = Context.getObjcIdType().getAsOpaquePtr();
+ PI.TypeInfo = Context.getObjCIdType().getAsOpaquePtr();
CurMethodDecl->setSelfDecl(ActOnParamDeclarator(PI, FnBodyScope));
PI.Ident = &Context.Idents.get("_cmd");
- PI.TypeInfo = Context.getObjcSelType().getAsOpaquePtr();
+ PI.TypeInfo = Context.getObjCSelType().getAsOpaquePtr();
ActOnParamDeclarator(PI, FnBodyScope);
for (int i = 0; i < MDecl->getNumParams(); i++) {
@@ -73,13 +73,13 @@
// Check for another declaration kind with the same name.
ScopedDecl *PrevDecl = LookupInterfaceDecl(ClassName);
- if (PrevDecl && !isa<ObjcInterfaceDecl>(PrevDecl)) {
+ if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
Diag(ClassLoc, diag::err_redefinition_different_kind,
ClassName->getName());
Diag(PrevDecl->getLocation(), diag::err_previous_definition);
}
- ObjcInterfaceDecl* IDecl = dyn_cast_or_null<ObjcInterfaceDecl>(PrevDecl);
+ ObjCInterfaceDecl* IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
if (IDecl) {
// Class already seen. Is it a forward declaration?
if (!IDecl->isForwardDecl())
@@ -91,7 +91,7 @@
}
}
else {
- IDecl = new ObjcInterfaceDecl(AtInterfaceLoc, NumProtocols, ClassName);
+ IDecl = new ObjCInterfaceDecl(AtInterfaceLoc, NumProtocols, ClassName);
// Chain & install the interface decl into the identifier.
IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>());
@@ -102,17 +102,17 @@
}
if (SuperName) {
- ObjcInterfaceDecl* SuperClassEntry = 0;
+ ObjCInterfaceDecl* SuperClassEntry = 0;
// Check if a different kind of symbol declared in this scope.
PrevDecl = LookupInterfaceDecl(SuperName);
- if (PrevDecl && !isa<ObjcInterfaceDecl>(PrevDecl)) {
+ if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
Diag(SuperLoc, diag::err_redefinition_different_kind,
SuperName->getName());
Diag(PrevDecl->getLocation(), diag::err_previous_definition);
}
else {
// Check that super class is previously defined
- SuperClassEntry = dyn_cast_or_null<ObjcInterfaceDecl>(PrevDecl);
+ SuperClassEntry = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
if (!SuperClassEntry || SuperClassEntry->isForwardDecl()) {
Diag(AtInterfaceLoc, diag::err_undef_superclass,
@@ -130,7 +130,7 @@
/// Check then save referenced protocols
if (NumProtocols) {
for (unsigned int i = 0; i != NumProtocols; i++) {
- ObjcProtocolDecl* RefPDecl = ObjcProtocols[ProtocolNames[i]];
+ ObjCProtocolDecl* RefPDecl = ObjCProtocols[ProtocolNames[i]];
if (!RefPDecl || RefPDecl->isForwardDecl())
Diag(ClassLoc, diag::warn_undef_protocolref,
ProtocolNames[i]->getName(),
@@ -152,7 +152,7 @@
ScopedDecl *ADecl = LookupScopedDecl(AliasName, Decl::IDNS_Ordinary,
AliasLocation, TUScope);
if (ADecl) {
- if (isa<ObjcCompatibleAliasDecl>(ADecl)) {
+ if (isa<ObjCCompatibleAliasDecl>(ADecl)) {
Diag(AliasLocation, diag::warn_previous_alias_decl);
Diag(ADecl->getLocation(), diag::warn_previous_declaration);
}
@@ -166,7 +166,7 @@
// Check for class declaration
ScopedDecl *CDecl = LookupScopedDecl(ClassName, Decl::IDNS_Ordinary,
ClassLocation, TUScope);
- if (!CDecl || !isa<ObjcInterfaceDecl>(CDecl)) {
+ if (!CDecl || !isa<ObjCInterfaceDecl>(CDecl)) {
Diag(ClassLocation, diag::warn_undef_interface,
ClassName->getName());
if (CDecl)
@@ -174,10 +174,10 @@
return 0;
}
// Everything checked out, instantiate a new alias declaration ast
- ObjcCompatibleAliasDecl *AliasDecl =
- new ObjcCompatibleAliasDecl(AtCompatibilityAliasLoc,
+ ObjCCompatibleAliasDecl *AliasDecl =
+ new ObjCCompatibleAliasDecl(AtCompatibilityAliasLoc,
AliasName,
- dyn_cast<ObjcInterfaceDecl>(CDecl));
+ dyn_cast<ObjCInterfaceDecl>(CDecl));
// Chain & install the interface decl into the identifier.
AliasDecl->setNext(AliasName->getFETokenInfo<ScopedDecl>());
@@ -191,7 +191,7 @@
IdentifierInfo **ProtoRefNames, unsigned NumProtoRefs,
SourceLocation EndProtoLoc) {
assert(ProtocolName && "Missing protocol identifier");
- ObjcProtocolDecl *PDecl = ObjcProtocols[ProtocolName];
+ ObjCProtocolDecl *PDecl = ObjCProtocols[ProtocolName];
if (PDecl) {
// Protocol already seen. Better be a forward protocol declaration
if (!PDecl->isForwardDecl())
@@ -203,15 +203,15 @@
}
}
else {
- PDecl = new ObjcProtocolDecl(AtProtoInterfaceLoc, NumProtoRefs,
+ PDecl = new ObjCProtocolDecl(AtProtoInterfaceLoc, NumProtoRefs,
ProtocolName);
- ObjcProtocols[ProtocolName] = PDecl;
+ ObjCProtocols[ProtocolName] = PDecl;
}
if (NumProtoRefs) {
/// Check then save referenced protocols
for (unsigned int i = 0; i != NumProtoRefs; i++) {
- ObjcProtocolDecl* RefPDecl = ObjcProtocols[ProtoRefNames[i]];
+ ObjCProtocolDecl* RefPDecl = ObjCProtocols[ProtoRefNames[i]];
if (!RefPDecl || RefPDecl->isForwardDecl())
Diag(ProtocolLoc, diag::warn_undef_protocolref,
ProtoRefNames[i]->getName(),
@@ -232,7 +232,7 @@
unsigned NumProtocols,
llvm::SmallVector<DeclTy *,8> &Protocols) {
for (unsigned i = 0; i != NumProtocols; ++i) {
- ObjcProtocolDecl *PDecl = ObjcProtocols[ProtocolId[i]];
+ ObjCProtocolDecl *PDecl = ObjCProtocols[ProtocolId[i]];
if (!PDecl)
Diag(TypeLoc, diag::err_undeclared_protocol,
ProtocolId[i]->getName());
@@ -245,20 +245,20 @@
Action::DeclTy *
Sema::ActOnForwardProtocolDeclaration(SourceLocation AtProtocolLoc,
IdentifierInfo **IdentList, unsigned NumElts) {
- llvm::SmallVector<ObjcProtocolDecl*, 32> Protocols;
+ llvm::SmallVector<ObjCProtocolDecl*, 32> Protocols;
for (unsigned i = 0; i != NumElts; ++i) {
IdentifierInfo *P = IdentList[i];
- ObjcProtocolDecl *PDecl = ObjcProtocols[P];
+ ObjCProtocolDecl *PDecl = ObjCProtocols[P];
if (!PDecl) { // Not already seen?
// FIXME: Pass in the location of the identifier!
- PDecl = new ObjcProtocolDecl(AtProtocolLoc, 0, P, true);
- ObjcProtocols[P] = PDecl;
+ PDecl = new ObjCProtocolDecl(AtProtocolLoc, 0, P, true);
+ ObjCProtocols[P] = PDecl;
}
Protocols.push_back(PDecl);
}
- return new ObjcForwardProtocolDecl(AtProtocolLoc,
+ return new ObjCForwardProtocolDecl(AtProtocolLoc,
&Protocols[0], Protocols.size());
}
@@ -268,18 +268,18 @@
IdentifierInfo *CategoryName, SourceLocation CategoryLoc,
IdentifierInfo **ProtoRefNames, unsigned NumProtoRefs,
SourceLocation EndProtoLoc) {
- ObjcInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName);
+ ObjCInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName);
/// Check that class of this category is already completely declared.
if (!IDecl || IDecl->isForwardDecl()) {
Diag(ClassLoc, diag::err_undef_interface, ClassName->getName());
return 0;
}
- ObjcCategoryDecl *CDecl = new ObjcCategoryDecl(AtInterfaceLoc, NumProtoRefs,
+ ObjCCategoryDecl *CDecl = new ObjCCategoryDecl(AtInterfaceLoc, NumProtoRefs,
CategoryName);
CDecl->setClassInterface(IDecl);
/// Check for duplicate interface declaration for this category
- ObjcCategoryDecl *CDeclChain;
+ ObjCCategoryDecl *CDeclChain;
for (CDeclChain = IDecl->getCategoryList(); CDeclChain;
CDeclChain = CDeclChain->getNextClassCategory()) {
if (CDeclChain->getIdentifier() == CategoryName) {
@@ -294,7 +294,7 @@
if (NumProtoRefs) {
/// Check then save referenced protocols
for (unsigned int i = 0; i != NumProtoRefs; i++) {
- ObjcProtocolDecl* RefPDecl = ObjcProtocols[ProtoRefNames[i]];
+ ObjCProtocolDecl* RefPDecl = ObjCProtocols[ProtoRefNames[i]];
if (!RefPDecl || RefPDecl->isForwardDecl()) {
Diag(CategoryLoc, diag::warn_undef_protocolref,
ProtoRefNames[i]->getName(),
@@ -308,14 +308,14 @@
}
/// ActOnStartCategoryImplementation - Perform semantic checks on the
-/// category implementation declaration and build an ObjcCategoryImplDecl
+/// category implementation declaration and build an ObjCCategoryImplDecl
/// object.
Sema::DeclTy *Sema::ActOnStartCategoryImplementation(
SourceLocation AtCatImplLoc,
IdentifierInfo *ClassName, SourceLocation ClassLoc,
IdentifierInfo *CatName, SourceLocation CatLoc) {
- ObjcInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName);
- ObjcCategoryImplDecl *CDecl = new ObjcCategoryImplDecl(AtCatImplLoc,
+ ObjCInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName);
+ ObjCCategoryImplDecl *CDecl = new ObjCCategoryImplDecl(AtCatImplLoc,
CatName, IDecl);
/// Check that class of this category is already completely declared.
if (!IDecl || IDecl->isForwardDecl())
@@ -331,33 +331,33 @@
IdentifierInfo *ClassName, SourceLocation ClassLoc,
IdentifierInfo *SuperClassname,
SourceLocation SuperClassLoc) {
- ObjcInterfaceDecl* IDecl = 0;
+ ObjCInterfaceDecl* IDecl = 0;
// Check for another declaration kind with the same name.
ScopedDecl *PrevDecl = LookupInterfaceDecl(ClassName);
- if (PrevDecl && !isa<ObjcInterfaceDecl>(PrevDecl)) {
+ if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
Diag(ClassLoc, diag::err_redefinition_different_kind,
ClassName->getName());
Diag(PrevDecl->getLocation(), diag::err_previous_definition);
}
else {
// Is there an interface declaration of this class; if not, warn!
- IDecl = dyn_cast_or_null<ObjcInterfaceDecl>(PrevDecl);
+ IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
if (!IDecl)
Diag(ClassLoc, diag::warn_undef_interface, ClassName->getName());
}
// Check that super class name is valid class name
- ObjcInterfaceDecl* SDecl = 0;
+ ObjCInterfaceDecl* SDecl = 0;
if (SuperClassname) {
// Check if a different kind of symbol declared in this scope.
PrevDecl = LookupInterfaceDecl(SuperClassname);
- if (PrevDecl && !isa<ObjcInterfaceDecl>(PrevDecl)) {
+ if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
Diag(SuperClassLoc, diag::err_redefinition_different_kind,
SuperClassname->getName());
Diag(PrevDecl->getLocation(), diag::err_previous_definition);
}
else {
- SDecl = dyn_cast_or_null<ObjcInterfaceDecl>(PrevDecl);
+ SDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
if (!SDecl)
Diag(SuperClassLoc, diag::err_undef_superclass,
SuperClassname->getName(), ClassName->getName());
@@ -374,7 +374,7 @@
if (!IDecl) {
// Legacy case of @implementation with no corresponding @interface.
// Build, chain & install the interface decl into the identifier.
- IDecl = new ObjcInterfaceDecl(AtClassImplLoc, 0, ClassName,
+ IDecl = new ObjCInterfaceDecl(AtClassImplLoc, 0, ClassName,
false, true);
IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>());
ClassName->setFETokenInfo(IDecl);
@@ -385,22 +385,22 @@
TUScope->AddDecl(IDecl);
}
- ObjcImplementationDecl* IMPDecl =
- new ObjcImplementationDecl(AtClassImplLoc, ClassName, IDecl, SDecl);
+ ObjCImplementationDecl* IMPDecl =
+ new ObjCImplementationDecl(AtClassImplLoc, ClassName, IDecl, SDecl);
// Check that there is no duplicate implementation of this class.
- if (ObjcImplementations[ClassName])
+ if (ObjCImplementations[ClassName])
Diag(ClassLoc, diag::err_dup_implementation_class, ClassName->getName());
else // add it to the list.
- ObjcImplementations[ClassName] = IMPDecl;
+ ObjCImplementations[ClassName] = IMPDecl;
return IMPDecl;
}
-void Sema::CheckImplementationIvars(ObjcImplementationDecl *ImpDecl,
- ObjcIvarDecl **ivars, unsigned numIvars,
+void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl,
+ ObjCIvarDecl **ivars, unsigned numIvars,
SourceLocation RBrace) {
assert(ImpDecl && "missing implementation decl");
- ObjcInterfaceDecl* IDecl = getObjCInterfaceDecl(ImpDecl->getIdentifier());
+ ObjCInterfaceDecl* IDecl = getObjCInterfaceDecl(ImpDecl->getIdentifier());
if (!IDecl)
return;
/// Check case of non-existing @interface decl.
@@ -420,11 +420,11 @@
// names and types must match.
//
unsigned j = 0;
- ObjcInterfaceDecl::ivar_iterator
+ ObjCInterfaceDecl::ivar_iterator
IVI = IDecl->ivar_begin(), IVE = IDecl->ivar_end();
for (; numIvars > 0 && IVI != IVE; ++IVI) {
- ObjcIvarDecl* ImplIvar = ivars[j++];
- ObjcIvarDecl* ClsIvar = *IVI;
+ ObjCIvarDecl* ImplIvar = ivars[j++];
+ ObjCIvarDecl* ClsIvar = *IVI;
assert (ImplIvar && "missing implementation ivar");
assert (ClsIvar && "missing class ivar");
if (ImplIvar->getCanonicalType() != ClsIvar->getCanonicalType()) {
@@ -453,49 +453,49 @@
/// CheckProtocolMethodDefs - This routine checks unimpletented methods
/// Declared in protocol, and those referenced by it.
-void Sema::CheckProtocolMethodDefs(ObjcProtocolDecl *PDecl,
+void Sema::CheckProtocolMethodDefs(ObjCProtocolDecl *PDecl,
bool& IncompleteImpl,
const llvm::DenseSet<Selector> &InsMap,
const llvm::DenseSet<Selector> &ClsMap) {
// check unimplemented instance methods.
- for (ObjcProtocolDecl::instmeth_iterator I = PDecl->instmeth_begin(),
+ for (ObjCProtocolDecl::instmeth_iterator I = PDecl->instmeth_begin(),
E = PDecl->instmeth_end(); I != E; ++I) {
- ObjcMethodDecl *method = *I;
+ ObjCMethodDecl *method = *I;
if (!InsMap.count(method->getSelector()) &&
- method->getImplementationControl() != ObjcMethodDecl::Optional) {
+ method->getImplementationControl() != ObjCMethodDecl::Optional) {
Diag(method->getLocation(), diag::warn_undef_method_impl,
method->getSelector().getName());
IncompleteImpl = true;
}
}
// check unimplemented class methods
- for (ObjcProtocolDecl::classmeth_iterator I = PDecl->classmeth_begin(),
+ for (ObjCProtocolDecl::classmeth_iterator I = PDecl->classmeth_begin(),
E = PDecl->classmeth_end(); I != E; ++I) {
- ObjcMethodDecl *method = *I;
+ ObjCMethodDecl *method = *I;
if (!ClsMap.count(method->getSelector()) &&
- method->getImplementationControl() != ObjcMethodDecl::Optional) {
+ method->getImplementationControl() != ObjCMethodDecl::Optional) {
Diag(method->getLocation(), diag::warn_undef_method_impl,
method->getSelector().getName());
IncompleteImpl = true;
}
}
// Check on this protocols's referenced protocols, recursively
- ObjcProtocolDecl** RefPDecl = PDecl->getReferencedProtocols();
+ ObjCProtocolDecl** RefPDecl = PDecl->getReferencedProtocols();
for (unsigned i = 0; i < PDecl->getNumReferencedProtocols(); i++)
CheckProtocolMethodDefs(RefPDecl[i], IncompleteImpl, InsMap, ClsMap);
}
-void Sema::ImplMethodsVsClassMethods(ObjcImplementationDecl* IMPDecl,
- ObjcInterfaceDecl* IDecl) {
+void Sema::ImplMethodsVsClassMethods(ObjCImplementationDecl* IMPDecl,
+ ObjCInterfaceDecl* IDecl) {
llvm::DenseSet<Selector> InsMap;
// Check and see if instance methods in class interface have been
// implemented in the implementation class.
- for (ObjcImplementationDecl::instmeth_iterator I = IMPDecl->instmeth_begin(),
+ for (ObjCImplementationDecl::instmeth_iterator I = IMPDecl->instmeth_begin(),
E = IMPDecl->instmeth_end(); I != E; ++I)
InsMap.insert((*I)->getSelector());
bool IncompleteImpl = false;
- for (ObjcInterfaceDecl::instmeth_iterator I = IDecl->instmeth_begin(),
+ for (ObjCInterfaceDecl::instmeth_iterator I = IDecl->instmeth_begin(),
E = IDecl->instmeth_end(); I != E; ++I)
if (!InsMap.count((*I)->getSelector())) {
Diag((*I)->getLocation(), diag::warn_undef_method_impl,
@@ -506,11 +506,11 @@
llvm::DenseSet<Selector> ClsMap;
// Check and see if class methods in class interface have been
// implemented in the implementation class.
- for (ObjcImplementationDecl::classmeth_iterator I =IMPDecl->classmeth_begin(),
+ for (ObjCImplementationDecl::classmeth_iterator I =IMPDecl->classmeth_begin(),
E = IMPDecl->classmeth_end(); I != E; ++I)
ClsMap.insert((*I)->getSelector());
- for (ObjcInterfaceDecl::classmeth_iterator I = IDecl->classmeth_begin(),
+ for (ObjCInterfaceDecl::classmeth_iterator I = IDecl->classmeth_begin(),
E = IDecl->classmeth_end(); I != E; ++I)
if (!ClsMap.count((*I)->getSelector())) {
Diag((*I)->getLocation(), diag::warn_undef_method_impl,
@@ -520,7 +520,7 @@
// Check the protocol list for unimplemented methods in the @implementation
// class.
- ObjcProtocolDecl** protocols = IDecl->getReferencedProtocols();
+ ObjCProtocolDecl** protocols = IDecl->getReferencedProtocols();
for (unsigned i = 0; i < IDecl->getNumIntfRefProtocols(); i++)
CheckProtocolMethodDefs(protocols[i], IncompleteImpl, InsMap, ClsMap);
@@ -531,17 +531,17 @@
/// ImplCategoryMethodsVsIntfMethods - Checks that methods declared in the
/// category interface is implemented in the category @implementation.
-void Sema::ImplCategoryMethodsVsIntfMethods(ObjcCategoryImplDecl *CatImplDecl,
- ObjcCategoryDecl *CatClassDecl) {
+void Sema::ImplCategoryMethodsVsIntfMethods(ObjCCategoryImplDecl *CatImplDecl,
+ ObjCCategoryDecl *CatClassDecl) {
llvm::DenseSet<Selector> InsMap;
// Check and see if instance methods in category interface have been
// implemented in its implementation class.
- for (ObjcCategoryImplDecl::instmeth_iterator I =CatImplDecl->instmeth_begin(),
+ for (ObjCCategoryImplDecl::instmeth_iterator I =CatImplDecl->instmeth_begin(),
E = CatImplDecl->instmeth_end(); I != E; ++I)
InsMap.insert((*I)->getSelector());
bool IncompleteImpl = false;
- for (ObjcCategoryDecl::instmeth_iterator I = CatClassDecl->instmeth_begin(),
+ for (ObjCCategoryDecl::instmeth_iterator I = CatClassDecl->instmeth_begin(),
E = CatClassDecl->instmeth_end(); I != E; ++I)
if (!InsMap.count((*I)->getSelector())) {
Diag((*I)->getLocation(), diag::warn_undef_method_impl,
@@ -551,12 +551,12 @@
llvm::DenseSet<Selector> ClsMap;
// Check and see if class methods in category interface have been
// implemented in its implementation class.
- for (ObjcCategoryImplDecl::classmeth_iterator
+ for (ObjCCategoryImplDecl::classmeth_iterator
I = CatImplDecl->classmeth_begin(), E = CatImplDecl->classmeth_end();
I != E; ++I)
ClsMap.insert((*I)->getSelector());
- for (ObjcCategoryDecl::classmeth_iterator I = CatClassDecl->classmeth_begin(),
+ for (ObjCCategoryDecl::classmeth_iterator I = CatClassDecl->classmeth_begin(),
E = CatClassDecl->classmeth_end(); I != E; ++I)
if (!ClsMap.count((*I)->getSelector())) {
Diag((*I)->getLocation(), diag::warn_undef_method_impl,
@@ -566,9 +566,9 @@
// Check the protocol list for unimplemented methods in the @implementation
// class.
- ObjcProtocolDecl** protocols = CatClassDecl->getReferencedProtocols();
+ ObjCProtocolDecl** protocols = CatClassDecl->getReferencedProtocols();
for (unsigned i = 0; i < CatClassDecl->getNumReferencedProtocols(); i++) {
- ObjcProtocolDecl* PDecl = protocols[i];
+ ObjCProtocolDecl* PDecl = protocols[i];
CheckProtocolMethodDefs(PDecl, IncompleteImpl, InsMap, ClsMap);
}
if (IncompleteImpl)
@@ -581,19 +581,19 @@
Sema::ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
IdentifierInfo **IdentList, unsigned NumElts)
{
- llvm::SmallVector<ObjcInterfaceDecl*, 32> Interfaces;
+ llvm::SmallVector<ObjCInterfaceDecl*, 32> Interfaces;
for (unsigned i = 0; i != NumElts; ++i) {
// Check for another declaration kind with the same name.
ScopedDecl *PrevDecl = LookupInterfaceDecl(IdentList[i]);
- if (PrevDecl && !isa<ObjcInterfaceDecl>(PrevDecl)) {
+ if (PrevDecl && !isa<ObjCInterfaceDecl>(PrevDecl)) {
Diag(AtClassLoc, diag::err_redefinition_different_kind,
IdentList[i]->getName());
Diag(PrevDecl->getLocation(), diag::err_previous_definition);
}
- ObjcInterfaceDecl *IDecl = dyn_cast_or_null<ObjcInterfaceDecl>(PrevDecl);
+ ObjCInterfaceDecl *IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
if (!IDecl) { // Not already seen? Make a forward decl.
- IDecl = new ObjcInterfaceDecl(AtClassLoc, 0, IdentList[i], true);
+ IDecl = new ObjCInterfaceDecl(AtClassLoc, 0, IdentList[i], true);
// Chain & install the interface decl into the identifier.
IDecl->setNext(IdentList[i]->getFETokenInfo<ScopedDecl>());
IdentList[i]->setFETokenInfo(IDecl);
@@ -605,15 +605,15 @@
Interfaces.push_back(IDecl);
}
- return new ObjcClassDecl(AtClassLoc, &Interfaces[0], Interfaces.size());
+ return new ObjCClassDecl(AtClassLoc, &Interfaces[0], Interfaces.size());
}
/// MatchTwoMethodDeclarations - Checks that two methods have matching type and
/// returns true, or false, accordingly.
/// TODO: Handle protocol list; such as id<p1,p2> in type comparisons
-bool Sema::MatchTwoMethodDeclarations(const ObjcMethodDecl *Method,
- const ObjcMethodDecl *PrevMethod) {
+bool Sema::MatchTwoMethodDeclarations(const ObjCMethodDecl *Method,
+ const ObjCMethodDecl *PrevMethod) {
if (Method->getResultType().getCanonicalType() !=
PrevMethod->getResultType().getCanonicalType())
return false;
@@ -626,8 +626,8 @@
return true;
}
-void Sema::AddInstanceMethodToGlobalPool(ObjcMethodDecl *Method) {
- ObjcMethodList &FirstMethod = InstanceMethodPool[Method->getSelector()];
+void Sema::AddInstanceMethodToGlobalPool(ObjCMethodDecl *Method) {
+ ObjCMethodList &FirstMethod = InstanceMethodPool[Method->getSelector()];
if (!FirstMethod.Method) {
// Haven't seen a method with this selector name yet - add it.
FirstMethod.Method = Method;
@@ -636,21 +636,21 @@
// We've seen a method with this name, now check the type signature(s).
bool match = MatchTwoMethodDeclarations(Method, FirstMethod.Method);
- for (ObjcMethodList *Next = FirstMethod.Next; !match && Next;
+ for (ObjCMethodList *Next = FirstMethod.Next; !match && Next;
Next = Next->Next)
match = MatchTwoMethodDeclarations(Method, Next->Method);
if (!match) {
// We have a new signature for an existing method - add it.
// This is extremely rare. Only 1% of Cocoa selectors are "overloaded".
- struct ObjcMethodList *OMI = new ObjcMethodList(Method, FirstMethod.Next);
+ struct ObjCMethodList *OMI = new ObjCMethodList(Method, FirstMethod.Next);
FirstMethod.Next = OMI;
}
}
}
-void Sema::AddFactoryMethodToGlobalPool(ObjcMethodDecl *Method) {
- ObjcMethodList &FirstMethod = FactoryMethodPool[Method->getSelector()];
+void Sema::AddFactoryMethodToGlobalPool(ObjCMethodDecl *Method) {
+ ObjCMethodList &FirstMethod = FactoryMethodPool[Method->getSelector()];
if (!FirstMethod.Method) {
// Haven't seen a method with this selector name yet - add it.
FirstMethod.Method = Method;
@@ -659,14 +659,14 @@
// We've seen a method with this name, now check the type signature(s).
bool match = MatchTwoMethodDeclarations(Method, FirstMethod.Method);
- for (ObjcMethodList *Next = FirstMethod.Next; !match && Next;
+ for (ObjCMethodList *Next = FirstMethod.Next; !match && Next;
Next = Next->Next)
match = MatchTwoMethodDeclarations(Method, Next->Method);
if (!match) {
// We have a new signature for an existing method - add it.
// This is extremely rare. Only 1% of Cocoa selectors are "overloaded".
- struct ObjcMethodList *OMI = new ObjcMethodList(Method, FirstMethod.Next);
+ struct ObjCMethodList *OMI = new ObjCMethodList(Method, FirstMethod.Next);
FirstMethod.Next = OMI;
}
}
@@ -685,33 +685,33 @@
if (!ClassDecl)
return;
- llvm::SmallVector<ObjcMethodDecl*, 32> insMethods;
- llvm::SmallVector<ObjcMethodDecl*, 16> clsMethods;
+ llvm::SmallVector<ObjCMethodDecl*, 32> insMethods;
+ llvm::SmallVector<ObjCMethodDecl*, 16> clsMethods;
- llvm::DenseMap<Selector, const ObjcMethodDecl*> InsMap;
- llvm::DenseMap<Selector, const ObjcMethodDecl*> ClsMap;
+ llvm::DenseMap<Selector, const ObjCMethodDecl*> InsMap;
+ llvm::DenseMap<Selector, const ObjCMethodDecl*> ClsMap;
bool isInterfaceDeclKind =
- (isa<ObjcInterfaceDecl>(ClassDecl) || isa<ObjcCategoryDecl>(ClassDecl)
- || isa<ObjcProtocolDecl>(ClassDecl));
- bool checkIdenticalMethods = isa<ObjcImplementationDecl>(ClassDecl);
+ (isa<ObjCInterfaceDecl>(ClassDecl) || isa<ObjCCategoryDecl>(ClassDecl)
+ || isa<ObjCProtocolDecl>(ClassDecl));
+ bool checkIdenticalMethods = isa<ObjCImplementationDecl>(ClassDecl);
// TODO: property declaration in category and protocols.
- if (pNum != 0 && isa<ObjcInterfaceDecl>(ClassDecl)) {
- ObjcPropertyDecl **properties = new ObjcPropertyDecl*[pNum];
- memcpy(properties, allProperties, pNum*sizeof(ObjcPropertyDecl*));
- dyn_cast<ObjcInterfaceDecl>(ClassDecl)->setPropertyDecls(properties);
- dyn_cast<ObjcInterfaceDecl>(ClassDecl)->setNumPropertyDecl(pNum);
+ if (pNum != 0 && isa<ObjCInterfaceDecl>(ClassDecl)) {
+ ObjCPropertyDecl **properties = new ObjCPropertyDecl*[pNum];
+ memcpy(properties, allProperties, pNum*sizeof(ObjCPropertyDecl*));
+ dyn_cast<ObjCInterfaceDecl>(ClassDecl)->setPropertyDecls(properties);
+ dyn_cast<ObjCInterfaceDecl>(ClassDecl)->setNumPropertyDecl(pNum);
}
for (unsigned i = 0; i < allNum; i++ ) {
- ObjcMethodDecl *Method =
- cast_or_null<ObjcMethodDecl>(static_cast<Decl*>(allMethods[i]));
+ ObjCMethodDecl *Method =
+ cast_or_null<ObjCMethodDecl>(static_cast<Decl*>(allMethods[i]));
if (!Method) continue; // Already issued a diagnostic.
if (Method->isInstance()) {
/// Check for instance method of the same name with incompatible types
- const ObjcMethodDecl *&PrevMethod = InsMap[Method->getSelector()];
+ const ObjCMethodDecl *&PrevMethod = InsMap[Method->getSelector()];
bool match = PrevMethod ? MatchTwoMethodDeclarations(Method, PrevMethod)
: false;
if (isInterfaceDeclKind && PrevMethod && !match
@@ -728,7 +728,7 @@
}
else {
/// Check for class method of the same name with incompatible types
- const ObjcMethodDecl *&PrevMethod = ClsMap[Method->getSelector()];
+ const ObjCMethodDecl *&PrevMethod = ClsMap[Method->getSelector()];
bool match = PrevMethod ? MatchTwoMethodDeclarations(Method, PrevMethod)
: false;
if (isInterfaceDeclKind && PrevMethod && !match
@@ -745,30 +745,30 @@
}
}
- if (ObjcInterfaceDecl *I = dyn_cast<ObjcInterfaceDecl>(ClassDecl)) {
+ if (ObjCInterfaceDecl *I = dyn_cast<ObjCInterfaceDecl>(ClassDecl)) {
I->addMethods(&insMethods[0], insMethods.size(),
&clsMethods[0], clsMethods.size(), AtEndLoc);
- } else if (ObjcProtocolDecl *P = dyn_cast<ObjcProtocolDecl>(ClassDecl)) {
+ } else if (ObjCProtocolDecl *P = dyn_cast<ObjCProtocolDecl>(ClassDecl)) {
P->addMethods(&insMethods[0], insMethods.size(),
&clsMethods[0], clsMethods.size(), AtEndLoc);
}
- else if (ObjcCategoryDecl *C = dyn_cast<ObjcCategoryDecl>(ClassDecl)) {
+ else if (ObjCCategoryDecl *C = dyn_cast<ObjCCategoryDecl>(ClassDecl)) {
C->addMethods(&insMethods[0], insMethods.size(),
&clsMethods[0], clsMethods.size(), AtEndLoc);
}
- else if (ObjcImplementationDecl *IC =
- dyn_cast<ObjcImplementationDecl>(ClassDecl)) {
+ else if (ObjCImplementationDecl *IC =
+ dyn_cast<ObjCImplementationDecl>(ClassDecl)) {
IC->setLocEnd(AtEndLoc);
- if (ObjcInterfaceDecl* IDecl = getObjCInterfaceDecl(IC->getIdentifier()))
+ if (ObjCInterfaceDecl* IDecl = getObjCInterfaceDecl(IC->getIdentifier()))
ImplMethodsVsClassMethods(IC, IDecl);
} else {
- ObjcCategoryImplDecl* CatImplClass = cast<ObjcCategoryImplDecl>(ClassDecl);
+ ObjCCategoryImplDecl* CatImplClass = cast<ObjCCategoryImplDecl>(ClassDecl);
CatImplClass->setLocEnd(AtEndLoc);
- ObjcInterfaceDecl* IDecl = CatImplClass->getClassInterface();
+ ObjCInterfaceDecl* IDecl = CatImplClass->getClassInterface();
// Find category interface decl and then check that all methods declared
// in this interface is implemented in the category @implementation.
if (IDecl) {
- for (ObjcCategoryDecl *Categories = IDecl->getCategoryList();
+ for (ObjCCategoryDecl *Categories = IDecl->getCategoryList();
Categories; Categories = Categories->getNextClassCategory()) {
if (Categories->getIdentifier() == CatImplClass->getIdentifier()) {
ImplCategoryMethodsVsIntfMethods(CatImplClass, Categories);
@@ -782,21 +782,21 @@
/// CvtQTToAstBitMask - utility routine to produce an AST bitmask for
/// objective-c's type qualifier from the parser version of the same info.
-static Decl::ObjcDeclQualifier
-CvtQTToAstBitMask(ObjcDeclSpec::ObjcDeclQualifier PQTVal) {
- Decl::ObjcDeclQualifier ret = Decl::OBJC_TQ_None;
- if (PQTVal & ObjcDeclSpec::DQ_In)
- ret = (Decl::ObjcDeclQualifier)(ret | Decl::OBJC_TQ_In);
- if (PQTVal & ObjcDeclSpec::DQ_Inout)
- ret = (Decl::ObjcDeclQualifier)(ret | Decl::OBJC_TQ_Inout);
- if (PQTVal & ObjcDeclSpec::DQ_Out)
- ret = (Decl::ObjcDeclQualifier)(ret | Decl::OBJC_TQ_Out);
- if (PQTVal & ObjcDeclSpec::DQ_Bycopy)
- ret = (Decl::ObjcDeclQualifier)(ret | Decl::OBJC_TQ_Bycopy);
- if (PQTVal & ObjcDeclSpec::DQ_Byref)
- ret = (Decl::ObjcDeclQualifier)(ret | Decl::OBJC_TQ_Byref);
- if (PQTVal & ObjcDeclSpec::DQ_Oneway)
- ret = (Decl::ObjcDeclQualifier)(ret | Decl::OBJC_TQ_Oneway);
+static Decl::ObjCDeclQualifier
+CvtQTToAstBitMask(ObjCDeclSpec::ObjCDeclQualifier PQTVal) {
+ Decl::ObjCDeclQualifier ret = Decl::OBJC_TQ_None;
+ if (PQTVal & ObjCDeclSpec::DQ_In)
+ ret = (Decl::ObjCDeclQualifier)(ret | Decl::OBJC_TQ_In);
+ if (PQTVal & ObjCDeclSpec::DQ_Inout)
+ ret = (Decl::ObjCDeclQualifier)(ret | Decl::OBJC_TQ_Inout);
+ if (PQTVal & ObjCDeclSpec::DQ_Out)
+ ret = (Decl::ObjCDeclQualifier)(ret | Decl::OBJC_TQ_Out);
+ if (PQTVal & ObjCDeclSpec::DQ_Bycopy)
+ ret = (Decl::ObjCDeclQualifier)(ret | Decl::OBJC_TQ_Bycopy);
+ if (PQTVal & ObjCDeclSpec::DQ_Byref)
+ ret = (Decl::ObjCDeclQualifier)(ret | Decl::OBJC_TQ_Byref);
+ if (PQTVal & ObjCDeclSpec::DQ_Oneway)
+ ret = (Decl::ObjCDeclQualifier)(ret | Decl::OBJC_TQ_Oneway);
return ret;
}
@@ -804,11 +804,11 @@
Sema::DeclTy *Sema::ActOnMethodDeclaration(
SourceLocation MethodLoc, SourceLocation EndLoc,
tok::TokenKind MethodType, DeclTy *ClassDecl,
- ObjcDeclSpec &ReturnQT, TypeTy *ReturnType,
+ ObjCDeclSpec &ReturnQT, TypeTy *ReturnType,
Selector Sel,
// optional arguments. The number of types/arguments is obtained
// from the Sel.getNumArgs().
- ObjcDeclSpec *ArgQT, TypeTy **ArgTypes, IdentifierInfo **ArgNames,
+ ObjCDeclSpec *ArgQT, TypeTy **ArgTypes, IdentifierInfo **ArgNames,
AttributeList *AttrList, tok::ObjCKeywordKind MethodDeclKind,
bool isVariadic) {
llvm::SmallVector<ParmVarDecl*, 16> Params;
@@ -820,11 +820,11 @@
if (ArgTypes[i])
argType = QualType::getFromOpaquePtr(ArgTypes[i]);
else
- argType = Context.getObjcIdType();
+ argType = Context.getObjCIdType();
ParmVarDecl* Param = new ParmVarDecl(SourceLocation(/*FIXME*/), ArgNames[i],
argType, VarDecl::None, 0);
- Param->setObjcDeclQualifier(
- CvtQTToAstBitMask(ArgQT[i].getObjcDeclQualifier()));
+ Param->setObjCDeclQualifier(
+ CvtQTToAstBitMask(ArgQT[i].getObjCDeclQualifier()));
Params.push_back(Param);
}
QualType resultDeclType;
@@ -832,91 +832,91 @@
if (ReturnType)
resultDeclType = QualType::getFromOpaquePtr(ReturnType);
else // get the type for "id".
- resultDeclType = Context.getObjcIdType();
+ resultDeclType = Context.getObjCIdType();
Decl *CDecl = static_cast<Decl*>(ClassDecl);
- ObjcMethodDecl* ObjcMethod = new ObjcMethodDecl(MethodLoc, EndLoc, Sel,
+ ObjCMethodDecl* ObjCMethod = new ObjCMethodDecl(MethodLoc, EndLoc, Sel,
resultDeclType,
CDecl,
0, -1, AttrList,
MethodType == tok::minus, isVariadic,
MethodDeclKind == tok::objc_optional ?
- ObjcMethodDecl::Optional :
- ObjcMethodDecl::Required);
- ObjcMethod->setMethodParams(&Params[0], Sel.getNumArgs());
- ObjcMethod->setObjcDeclQualifier(
- CvtQTToAstBitMask(ReturnQT.getObjcDeclQualifier()));
- const ObjcMethodDecl *PrevMethod = 0;
+ ObjCMethodDecl::Optional :
+ ObjCMethodDecl::Required);
+ ObjCMethod->setMethodParams(&Params[0], Sel.getNumArgs());
+ ObjCMethod->setObjCDeclQualifier(
+ CvtQTToAstBitMask(ReturnQT.getObjCDeclQualifier()));
+ const ObjCMethodDecl *PrevMethod = 0;
// For implementations (which can be very "coarse grain"), we add the
// method now. This allows the AST to implement lookup methods that work
// incrementally (without waiting until we parse the @end). It also allows
// us to flag multiple declaration errors as they occur.
- if (ObjcImplementationDecl *ImpDecl =
- dyn_cast<ObjcImplementationDecl>(CDecl)) {
+ if (ObjCImplementationDecl *ImpDecl =
+ dyn_cast<ObjCImplementationDecl>(CDecl)) {
if (MethodType == tok::minus) {
PrevMethod = ImpDecl->getInstanceMethod(Sel);
- ImpDecl->addInstanceMethod(ObjcMethod);
+ ImpDecl->addInstanceMethod(ObjCMethod);
} else {
PrevMethod = ImpDecl->getClassMethod(Sel);
- ImpDecl->addClassMethod(ObjcMethod);
+ ImpDecl->addClassMethod(ObjCMethod);
}
}
- else if (ObjcCategoryImplDecl *CatImpDecl =
- dyn_cast<ObjcCategoryImplDecl>(CDecl)) {
+ else if (ObjCCategoryImplDecl *CatImpDecl =
+ dyn_cast<ObjCCategoryImplDecl>(CDecl)) {
if (MethodType == tok::minus) {
PrevMethod = CatImpDecl->getInstanceMethod(Sel);
- CatImpDecl->addInstanceMethod(ObjcMethod);
+ CatImpDecl->addInstanceMethod(ObjCMethod);
} else {
PrevMethod = CatImpDecl->getClassMethod(Sel);
- CatImpDecl->addClassMethod(ObjcMethod);
+ CatImpDecl->addClassMethod(ObjCMethod);
}
}
if (PrevMethod) {
// You can never have two method definitions with the same name.
- Diag(ObjcMethod->getLocation(), diag::error_duplicate_method_decl,
- ObjcMethod->getSelector().getName());
+ Diag(ObjCMethod->getLocation(), diag::error_duplicate_method_decl,
+ ObjCMethod->getSelector().getName());
Diag(PrevMethod->getLocation(), diag::err_previous_declaration);
}
- return ObjcMethod;
+ return ObjCMethod;
}
-Sema::DeclTy *Sema::ActOnAddObjcProperties(SourceLocation AtLoc,
- DeclTy **allProperties, unsigned NumProperties, ObjcDeclSpec &DS) {
- ObjcPropertyDecl *PDecl = new ObjcPropertyDecl(AtLoc);
+Sema::DeclTy *Sema::ActOnAddObjCProperties(SourceLocation AtLoc,
+ DeclTy **allProperties, unsigned NumProperties, ObjCDeclSpec &DS) {
+ ObjCPropertyDecl *PDecl = new ObjCPropertyDecl(AtLoc);
- if(DS.getPropertyAttributes() & ObjcDeclSpec::DQ_PR_readonly)
- PDecl->setPropertyAttributes(ObjcPropertyDecl::OBJC_PR_readonly);
+ if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_readonly)
+ PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
- if(DS.getPropertyAttributes() & ObjcDeclSpec::DQ_PR_getter) {
- PDecl->setPropertyAttributes(ObjcPropertyDecl::OBJC_PR_getter);
+ if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_getter) {
+ PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_getter);
PDecl->setGetterName(DS.getGetterName());
}
- if(DS.getPropertyAttributes() & ObjcDeclSpec::DQ_PR_setter) {
- PDecl->setPropertyAttributes(ObjcPropertyDecl::OBJC_PR_setter);
+ if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_setter) {
+ PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_setter);
PDecl->setSetterName(DS.getSetterName());
}
- if(DS.getPropertyAttributes() & ObjcDeclSpec::DQ_PR_assign)
- PDecl->setPropertyAttributes(ObjcPropertyDecl::OBJC_PR_assign);
+ if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_assign)
+ PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
- if(DS.getPropertyAttributes() & ObjcDeclSpec::DQ_PR_readwrite)
- PDecl->setPropertyAttributes(ObjcPropertyDecl::OBJC_PR_readwrite);
+ if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_readwrite)
+ PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
- if(DS.getPropertyAttributes() & ObjcDeclSpec::DQ_PR_retain)
- PDecl->setPropertyAttributes(ObjcPropertyDecl::OBJC_PR_retain);
+ if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_retain)
+ PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
- if(DS.getPropertyAttributes() & ObjcDeclSpec::DQ_PR_copy)
- PDecl->setPropertyAttributes(ObjcPropertyDecl::OBJC_PR_copy);
+ if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_copy)
+ PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
- if(DS.getPropertyAttributes() & ObjcDeclSpec::DQ_PR_nonatomic)
- PDecl->setPropertyAttributes(ObjcPropertyDecl::OBJC_PR_nonatomic);
+ if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nonatomic)
+ PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic);
PDecl->setNumPropertyDecls(NumProperties);
if (NumProperties != 0) {
- ObjcIvarDecl **properties = new ObjcIvarDecl*[NumProperties];
- memcpy(properties, allProperties, NumProperties*sizeof(ObjcIvarDecl*));
+ ObjCIvarDecl **properties = new ObjCIvarDecl*[NumProperties];
+ memcpy(properties, allProperties, NumProperties*sizeof(ObjCIvarDecl*));
PDecl->setPropertyDecls(properties);
}
return PDecl;
Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Mon Jan 7 13:49:32 2008
@@ -81,9 +81,9 @@
D = ImplicitlyDefineFunction(Loc, II, S);
else {
if (CurMethodDecl) {
- ObjcInterfaceDecl *IFace = CurMethodDecl->getClassInterface();
- ObjcInterfaceDecl *clsDeclared;
- if (ObjcIvarDecl *IV = IFace->lookupInstanceVariable(&II, clsDeclared)) {
+ ObjCInterfaceDecl *IFace = CurMethodDecl->getClassInterface();
+ ObjCInterfaceDecl *clsDeclared;
+ if (ObjCIvarDecl *IV = IFace->lookupInstanceVariable(&II, clsDeclared)) {
IdentifierInfo &II = Context.Idents.get("self");
ExprResult SelfExpr = ActOnIdentifierExpr(S, Loc, II, false);
return new ObjCIvarRefExpr(IV, IV->getType(), Loc,
@@ -103,7 +103,7 @@
}
if (isa<TypedefDecl>(D))
return Diag(Loc, diag::err_unexpected_typedef, II.getName());
- if (isa<ObjcInterfaceDecl>(D))
+ if (isa<ObjCInterfaceDecl>(D))
return Diag(Loc, diag::err_unexpected_interface, II.getName());
assert(0 && "Invalid decl");
@@ -535,14 +535,14 @@
if (ret.isNull())
return true;
return new OCUVectorElementExpr(ret, BaseExpr, Member, MemberLoc);
- } else if (BaseType->isObjcInterfaceType()) {
- ObjcInterfaceDecl *IFace;
- if (isa<ObjcInterfaceType>(BaseType.getCanonicalType()))
- IFace = dyn_cast<ObjcInterfaceType>(BaseType)->getDecl();
+ } else if (BaseType->isObjCInterfaceType()) {
+ ObjCInterfaceDecl *IFace;
+ if (isa<ObjCInterfaceType>(BaseType.getCanonicalType()))
+ IFace = dyn_cast<ObjCInterfaceType>(BaseType)->getDecl();
else
- IFace = dyn_cast<ObjcQualifiedInterfaceType>(BaseType)->getDecl();
- ObjcInterfaceDecl *clsDeclared;
- if (ObjcIvarDecl *IV = IFace->lookupInstanceVariable(&Member, clsDeclared))
+ IFace = dyn_cast<ObjCQualifiedInterfaceType>(BaseType)->getDecl();
+ ObjCInterfaceDecl *clsDeclared;
+ if (ObjCIvarDecl *IV = IFace->lookupInstanceVariable(&Member, clsDeclared))
return new ObjCIvarRefExpr(IV, IV->getType(), MemberLoc, BaseExpr,
OpKind==tok::arrow);
}
@@ -1109,9 +1109,9 @@
return Incompatible;
}
- if (lhsType->isObjcQualifiedIdType()
- || rhsType->isObjcQualifiedIdType()) {
- if (Context.ObjcQualifiedIdTypesAreCompatible(lhsType, rhsType))
+ if (lhsType->isObjCQualifiedIdType()
+ || rhsType->isObjCQualifiedIdType()) {
+ if (Context.ObjCQualifiedIdTypesAreCompatible(lhsType, rhsType))
return Compatible;
return Incompatible;
}
@@ -1172,7 +1172,7 @@
Sema::CheckSingleAssignmentConstraints(QualType lhsType, Expr *&rExpr) {
// C99 6.5.16.1p1: the left operand is a pointer and the right is
// a null pointer constant.
- if ((lhsType->isPointerType() || lhsType->isObjcQualifiedIdType())
+ if ((lhsType->isPointerType() || lhsType->isObjCQualifiedIdType())
&& rExpr->isNullPointerConstant(Context)) {
promoteExprToType(rExpr, lhsType);
return Compatible;
@@ -1428,8 +1428,8 @@
promoteExprToType(rex, lType); // promote the pointer to pointer
return Context.IntTy;
}
- if ((lType->isObjcQualifiedIdType() || rType->isObjcQualifiedIdType())
- && Context.ObjcQualifiedIdTypesAreCompatible(lType, rType, true)) {
+ if ((lType->isObjCQualifiedIdType() || rType->isObjCQualifiedIdType())
+ && Context.ObjCQualifiedIdTypesAreCompatible(lType, rType, true)) {
promoteExprToType(rex, lType);
return Context.IntTy;
}
Modified: cfe/trunk/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExprObjC.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/Sema/SemaExprObjC.cpp Mon Jan 7 13:49:32 2008
@@ -48,19 +48,19 @@
if (CheckBuiltinCFStringArgument(S))
return true;
- if (Context.getObjcConstantStringInterface().isNull()) {
+ if (Context.getObjCConstantStringInterface().isNull()) {
// Initialize the constant string interface lazily. This assumes
// the NSConstantString interface is seen in this translation unit.
IdentifierInfo *NSIdent = &Context.Idents.get("NSConstantString");
ScopedDecl *IFace = LookupScopedDecl(NSIdent, Decl::IDNS_Ordinary,
SourceLocation(), TUScope);
- ObjcInterfaceDecl *strIFace = dyn_cast_or_null<ObjcInterfaceDecl>(IFace);
+ ObjCInterfaceDecl *strIFace = dyn_cast_or_null<ObjCInterfaceDecl>(IFace);
if (!strIFace)
return Diag(S->getLocStart(), diag::err_undef_interface,
NSIdent->getName());
- Context.setObjcConstantStringInterface(strIFace);
+ Context.setObjCConstantStringInterface(strIFace);
}
- QualType t = Context.getObjcConstantStringInterface();
+ QualType t = Context.getObjCConstantStringInterface();
t = Context.getPointerType(t);
return new ObjCStringLiteral(S, t, AtLoc);
}
@@ -81,7 +81,7 @@
SourceLocation SelLoc,
SourceLocation LParenLoc,
SourceLocation RParenLoc) {
- QualType t = Context.getObjcSelType();
+ QualType t = Context.getObjCSelType();
return new ObjCSelectorExpr(t, Sel, AtLoc, RParenLoc);
}
@@ -90,13 +90,13 @@
SourceLocation ProtoLoc,
SourceLocation LParenLoc,
SourceLocation RParenLoc) {
- ObjcProtocolDecl* PDecl = ObjcProtocols[ProtocolId];
+ ObjCProtocolDecl* PDecl = ObjCProtocols[ProtocolId];
if (!PDecl) {
Diag(ProtoLoc, diag::err_undeclared_protocol, ProtocolId->getName());
return true;
}
- QualType t = Context.getObjcProtoType();
+ QualType t = Context.getObjCProtoType();
if (t.isNull())
return true;
t = Context.getPointerType(t);
@@ -104,7 +104,7 @@
}
bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs,
- ObjcMethodDecl *Method) {
+ ObjCMethodDecl *Method) {
bool anyIncompatibleArgs = false;
for (unsigned i = 0; i < NumArgs; i++) {
@@ -143,7 +143,7 @@
assert(receiverName && "missing receiver class name");
Expr **ArgExprs = reinterpret_cast<Expr **>(Args);
- ObjcInterfaceDecl* ClassDecl = 0;
+ ObjCInterfaceDecl* ClassDecl = 0;
if (!strcmp(receiverName->getName(), "super") && CurMethodDecl) {
ClassDecl = CurMethodDecl->getClassInterface()->getSuperClass();
if (ClassDecl && CurMethodDecl->isInstance()) {
@@ -151,7 +151,7 @@
// represent super without creating a special expression node.
IdentifierInfo &II = Context.Idents.get("self");
ExprResult ReceiverExpr = ActOnIdentifierExpr(S, lbrac, II, false);
- QualType superTy = Context.getObjcInterfaceType(ClassDecl);
+ QualType superTy = Context.getObjCInterfaceType(ClassDecl);
superTy = Context.getPointerType(superTy);
ReceiverExpr = ActOnCastExpr(SourceLocation(), superTy.getAsOpaquePtr(),
SourceLocation(), ReceiverExpr.Val);
@@ -165,7 +165,7 @@
ClassDecl = getObjCInterfaceDecl(receiverName);
// FIXME: can ClassDecl ever be null?
- ObjcMethodDecl *Method = ClassDecl->lookupClassMethod(Sel);
+ ObjCMethodDecl *Method = ClassDecl->lookupClassMethod(Sel);
QualType returnType;
// Before we give up, check if the selector is an instance method.
@@ -174,7 +174,7 @@
if (!Method) {
Diag(lbrac, diag::warn_method_not_found, std::string("+"), Sel.getName(),
SourceRange(lbrac, rbrac));
- returnType = Context.getObjcIdType();
+ returnType = Context.getObjCIdType();
} else {
returnType = Method->getResultType();
if (Sel.getNumArgs()) {
@@ -199,17 +199,17 @@
Expr *RExpr = static_cast<Expr *>(receiver);
QualType receiverType = RExpr->getType();
QualType returnType;
- ObjcMethodDecl *Method = 0;
+ ObjCMethodDecl *Method = 0;
- if (receiverType == Context.getObjcIdType() ||
- receiverType == Context.getObjcClassType()) {
+ if (receiverType == Context.getObjCIdType() ||
+ receiverType == Context.getObjCClassType()) {
Method = InstanceMethodPool[Sel].Method;
if (!Method)
Method = FactoryMethodPool[Sel].Method;
if (!Method) {
Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(),
SourceRange(lbrac, rbrac));
- returnType = Context.getObjcIdType();
+ returnType = Context.getObjCIdType();
} else {
returnType = Method->getResultType();
if (Sel.getNumArgs())
@@ -217,7 +217,7 @@
return true;
}
} else {
- bool receiverIsQualId = isa<ObjcQualifiedIdType>(receiverType);
+ bool receiverIsQualId = isa<ObjCQualifiedIdType>(receiverType);
// FIXME (snaroff): checking in this code from Patrick. Needs to be
// revisited. how do we get the ClassDecl from the receiver expression?
if (!receiverIsQualId)
@@ -226,15 +226,15 @@
static_cast<PointerType*>(receiverType.getTypePtr());
receiverType = pointerType->getPointeeType();
}
- ObjcInterfaceDecl* ClassDecl = 0;
- if (ObjcQualifiedInterfaceType *QIT =
- dyn_cast<ObjcQualifiedInterfaceType>(receiverType)) {
+ ObjCInterfaceDecl* ClassDecl = 0;
+ if (ObjCQualifiedInterfaceType *QIT =
+ dyn_cast<ObjCQualifiedInterfaceType>(receiverType)) {
ClassDecl = QIT->getDecl();
Method = ClassDecl->lookupInstanceMethod(Sel);
if (!Method) {
// search protocols
for (unsigned i = 0; i < QIT->getNumProtocols(); i++) {
- ObjcProtocolDecl *PDecl = QIT->getProtocols(i);
+ ObjCProtocolDecl *PDecl = QIT->getProtocols(i);
if (PDecl && (Method = PDecl->lookupInstanceMethod(Sel)))
break;
}
@@ -244,11 +244,11 @@
std::string("-"), Sel.getName(),
SourceRange(lbrac, rbrac));
}
- else if (ObjcQualifiedIdType *QIT =
- dyn_cast<ObjcQualifiedIdType>(receiverType)) {
+ else if (ObjCQualifiedIdType *QIT =
+ dyn_cast<ObjCQualifiedIdType>(receiverType)) {
// search protocols
for (unsigned i = 0; i < QIT->getNumProtocols(); i++) {
- ObjcProtocolDecl *PDecl = QIT->getProtocols(i);
+ ObjCProtocolDecl *PDecl = QIT->getProtocols(i);
if (PDecl && (Method = PDecl->lookupInstanceMethod(Sel)))
break;
}
@@ -258,9 +258,9 @@
SourceRange(lbrac, rbrac));
}
else {
- assert(ObjcInterfaceType::classof(receiverType.getTypePtr()) &&
+ assert(ObjCInterfaceType::classof(receiverType.getTypePtr()) &&
"bad receiver type");
- ClassDecl = static_cast<ObjcInterfaceType*>(
+ ClassDecl = static_cast<ObjCInterfaceType*>(
receiverType.getTypePtr())->getDecl();
// FIXME: consider using InstanceMethodPool, since it will be faster
// than the following method (which can do *many* linear searches). The
@@ -270,8 +270,8 @@
if (!Method) {
// If we have an implementation in scope, check "private" methods.
if (ClassDecl)
- if (ObjcImplementationDecl *ImpDecl =
- ObjcImplementations[ClassDecl->getIdentifier()])
+ if (ObjCImplementationDecl *ImpDecl =
+ ObjCImplementations[ClassDecl->getIdentifier()])
Method = ImpDecl->getInstanceMethod(Sel);
// If we still haven't found a method, look in the global pool. This
// behavior isn't very desirable, however we need it for GCC
@@ -282,7 +282,7 @@
if (!Method) {
Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(),
SourceRange(lbrac, rbrac));
- returnType = Context.getObjcIdType();
+ returnType = Context.getObjCIdType();
} else {
returnType = Method->getResultType();
if (Sel.getNumArgs())
Modified: cfe/trunk/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaStmt.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/Sema/SemaStmt.cpp Mon Jan 7 13:49:32 2008
@@ -531,7 +531,7 @@
}
Action::StmtResult
-Sema::ActOnObjcForCollectionStmt(SourceLocation ForColLoc,
+Sema::ActOnObjCForCollectionStmt(SourceLocation ForColLoc,
SourceLocation LParenLoc,
StmtTy *first, ExprTy *second,
SourceLocation RParenLoc, StmtTy *body) {
@@ -552,17 +552,17 @@
}
else
FirstType = static_cast<Expr*>(first)->getType();
- if (!isObjcObjectPointerType(FirstType))
+ if (!isObjCObjectPointerType(FirstType))
Diag(ForColLoc, diag::err_selector_element_type,
FirstType.getAsString(), First->getSourceRange());
if (Second) {
DefaultFunctionArrayConversion(Second);
QualType SecondType = Second->getType();
- if (!isObjcObjectPointerType(SecondType))
+ if (!isObjCObjectPointerType(SecondType))
Diag(ForColLoc, diag::err_collection_expr_type,
SecondType.getAsString(), Second->getSourceRange());
}
- return new ObjcForCollectionStmt(First, Second, Body, ForColLoc);
+ return new ObjCForCollectionStmt(First, Second, Body, ForColLoc);
}
Action::StmtResult
@@ -764,34 +764,34 @@
}
Action::StmtResult
-Sema::ActOnObjcAtCatchStmt(SourceLocation AtLoc,
+Sema::ActOnObjCAtCatchStmt(SourceLocation AtLoc,
SourceLocation RParen, StmtTy *Parm,
StmtTy *Body, StmtTy *CatchList) {
- ObjcAtCatchStmt *CS = new ObjcAtCatchStmt(AtLoc, RParen,
+ ObjCAtCatchStmt *CS = new ObjCAtCatchStmt(AtLoc, RParen,
static_cast<Stmt*>(Parm), static_cast<Stmt*>(Body),
static_cast<Stmt*>(CatchList));
return CatchList ? CatchList : CS;
}
Action::StmtResult
-Sema::ActOnObjcAtFinallyStmt(SourceLocation AtLoc, StmtTy *Body) {
- ObjcAtFinallyStmt *FS = new ObjcAtFinallyStmt(AtLoc,
+Sema::ActOnObjCAtFinallyStmt(SourceLocation AtLoc, StmtTy *Body) {
+ ObjCAtFinallyStmt *FS = new ObjCAtFinallyStmt(AtLoc,
static_cast<Stmt*>(Body));
return FS;
}
Action::StmtResult
-Sema::ActOnObjcAtTryStmt(SourceLocation AtLoc,
+Sema::ActOnObjCAtTryStmt(SourceLocation AtLoc,
StmtTy *Try, StmtTy *Catch, StmtTy *Finally) {
- ObjcAtTryStmt *TS = new ObjcAtTryStmt(AtLoc, static_cast<Stmt*>(Try),
+ ObjCAtTryStmt *TS = new ObjCAtTryStmt(AtLoc, static_cast<Stmt*>(Try),
static_cast<Stmt*>(Catch),
static_cast<Stmt*>(Finally));
return TS;
}
Action::StmtResult
-Sema::ActOnObjcAtThrowStmt(SourceLocation AtLoc, StmtTy *Throw) {
- ObjcAtThrowStmt *TS = new ObjcAtThrowStmt(AtLoc, static_cast<Stmt*>(Throw));
+Sema::ActOnObjCAtThrowStmt(SourceLocation AtLoc, StmtTy *Throw) {
+ ObjCAtThrowStmt *TS = new ObjCAtThrowStmt(AtLoc, static_cast<Stmt*>(Throw));
return TS;
}
Modified: cfe/trunk/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaType.cpp?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaType.cpp (original)
+++ cfe/trunk/Sema/SemaType.cpp Mon Jan 7 13:49:32 2008
@@ -104,22 +104,22 @@
"Can't handle qualifiers on typedef names yet!");
// FIXME: Adding a TST_objcInterface clause doesn't seem ideal, so
// we have this "hack" for now...
- if (ObjcInterfaceDecl *ObjcIntDecl = dyn_cast<ObjcInterfaceDecl>(D)) {
+ if (ObjCInterfaceDecl *ObjCIntDecl = dyn_cast<ObjCInterfaceDecl>(D)) {
if (DS.getProtocolQualifiers() == 0)
- return Ctx.getObjcInterfaceType(ObjcIntDecl);
+ return Ctx.getObjCInterfaceType(ObjCIntDecl);
Action::DeclTy **PPDecl = &(*DS.getProtocolQualifiers())[0];
- return Ctx.getObjcQualifiedInterfaceType(ObjcIntDecl,
- reinterpret_cast<ObjcProtocolDecl**>(PPDecl),
+ return Ctx.getObjCQualifiedInterfaceType(ObjCIntDecl,
+ reinterpret_cast<ObjCProtocolDecl**>(PPDecl),
DS.NumProtocolQualifiers());
}
else if (TypedefDecl *typeDecl = dyn_cast<TypedefDecl>(D)) {
- if (Ctx.getObjcIdType() == Ctx.getTypedefType(typeDecl)
+ if (Ctx.getObjCIdType() == Ctx.getTypedefType(typeDecl)
&& DS.getProtocolQualifiers()) {
// id<protocol-list>
Action::DeclTy **PPDecl = &(*DS.getProtocolQualifiers())[0];
- return Ctx.getObjcQualifiedIdType(typeDecl->getUnderlyingType(),
- reinterpret_cast<ObjcProtocolDecl**>(PPDecl),
+ return Ctx.getObjCQualifiedIdType(typeDecl->getUnderlyingType(),
+ reinterpret_cast<ObjCProtocolDecl**>(PPDecl),
DS.NumProtocolQualifiers());
}
}
@@ -346,22 +346,22 @@
return T;
}
-/// ObjcGetTypeForMethodDefinition - Builds the type for a method definition
+/// ObjCGetTypeForMethodDefinition - Builds the type for a method definition
/// declarator
-QualType Sema::ObjcGetTypeForMethodDefinition(DeclTy *D) {
- ObjcMethodDecl *MDecl = dyn_cast<ObjcMethodDecl>(static_cast<Decl *>(D));
+QualType Sema::ObjCGetTypeForMethodDefinition(DeclTy *D) {
+ ObjCMethodDecl *MDecl = dyn_cast<ObjCMethodDecl>(static_cast<Decl *>(D));
QualType T = MDecl->getResultType();
llvm::SmallVector<QualType, 16> ArgTys;
// Add the first two invisible argument types for self and _cmd.
if (MDecl->isInstance()) {
- QualType selfTy = Context.getObjcInterfaceType(MDecl->getClassInterface());
+ QualType selfTy = Context.getObjCInterfaceType(MDecl->getClassInterface());
selfTy = Context.getPointerType(selfTy);
ArgTys.push_back(selfTy);
}
else
- ArgTys.push_back(Context.getObjcIdType());
- ArgTys.push_back(Context.getObjcSelType());
+ ArgTys.push_back(Context.getObjCIdType());
+ ArgTys.push_back(Context.getObjCSelType());
for (int i = 0; i < MDecl->getNumParams(); i++) {
ParmVarDecl *PDecl = MDecl->getParamDecl(i);
Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Mon Jan 7 13:49:32 2008
@@ -41,8 +41,8 @@
llvm::FoldingSet<VectorType> VectorTypes;
llvm::FoldingSet<FunctionTypeNoProto> FunctionTypeNoProtos;
llvm::FoldingSet<FunctionTypeProto> FunctionTypeProtos;
- llvm::FoldingSet<ObjcQualifiedInterfaceType> ObjcQualifiedInterfaceTypes;
- llvm::FoldingSet<ObjcQualifiedIdType> ObjcQualifiedIdTypes;
+ llvm::FoldingSet<ObjCQualifiedInterfaceType> ObjCQualifiedInterfaceTypes;
+ llvm::FoldingSet<ObjCQualifiedIdType> ObjCQualifiedIdTypes;
/// ASTRecordLayouts - A cache mapping from RecordDecls to ASTRecordLayouts.
/// This is lazily created. This is intentionally not serialized.
llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*> ASTRecordLayouts;
@@ -52,23 +52,23 @@
/// a builtin that takes a valist is encountered.
QualType BuiltinVaListType;
- /// ObjcIdType - a psuedo built-in typedef type (set by Sema).
- QualType ObjcIdType;
+ /// ObjCIdType - a psuedo built-in typedef type (set by Sema).
+ QualType ObjCIdType;
const RecordType *IdStructType;
- /// ObjcSelType - another psuedo built-in typedef type (set by Sema).
- QualType ObjcSelType;
+ /// ObjCSelType - another psuedo built-in typedef type (set by Sema).
+ QualType ObjCSelType;
const RecordType *SelStructType;
- /// ObjcProtoType - another psuedo built-in typedef type (set by Sema).
- QualType ObjcProtoType;
+ /// ObjCProtoType - another psuedo built-in typedef type (set by Sema).
+ QualType ObjCProtoType;
const RecordType *ProtoStructType;
- /// ObjcClassType - another psuedo built-in typedef type (set by Sema).
- QualType ObjcClassType;
+ /// ObjCClassType - another psuedo built-in typedef type (set by Sema).
+ QualType ObjCClassType;
const RecordType *ClassStructType;
- QualType ObjcConstantStringType;
+ QualType ObjCConstantStringType;
RecordDecl *CFConstantStringTypeDecl;
SourceManager &SourceMgr;
@@ -162,18 +162,18 @@
/// getTypedefType - Return the unique reference to the type for the
/// specified typename decl.
QualType getTypedefType(TypedefDecl *Decl);
- QualType getObjcInterfaceType(ObjcInterfaceDecl *Decl);
+ QualType getObjCInterfaceType(ObjCInterfaceDecl *Decl);
- /// getObjcQualifiedInterfaceType - Return a
- /// ObjcQualifiedInterfaceType type for the given interface decl and
+ /// getObjCQualifiedInterfaceType - Return a
+ /// ObjCQualifiedInterfaceType type for the given interface decl and
/// the conforming protocol list.
- QualType getObjcQualifiedInterfaceType(ObjcInterfaceDecl *Decl,
- ObjcProtocolDecl **ProtocolList, unsigned NumProtocols);
+ QualType getObjCQualifiedInterfaceType(ObjCInterfaceDecl *Decl,
+ ObjCProtocolDecl **ProtocolList, unsigned NumProtocols);
- /// getObjcQualifiedIdType - Return an ObjcQualifiedIdType for a
+ /// getObjCQualifiedIdType - Return an ObjCQualifiedIdType for a
/// given 'id' and conforming protocol list.
- QualType getObjcQualifiedIdType(QualType idType,
- ObjcProtocolDecl **ProtocolList,
+ QualType getObjCQualifiedIdType(QualType idType,
+ ObjCProtocolDecl **ProtocolList,
unsigned NumProtocols);
@@ -198,39 +198,39 @@
QualType getCFConstantStringType();
// This setter/getter represents the ObjC type for an NSConstantString.
- void setObjcConstantStringInterface(ObjcInterfaceDecl *Decl);
- QualType getObjcConstantStringInterface() const {
- return ObjcConstantStringType;
+ void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl);
+ QualType getObjCConstantStringInterface() const {
+ return ObjCConstantStringType;
}
// Return the ObjC type encoding for a given type.
- void getObjcEncodingForType(QualType t, std::string &S) const;
+ void getObjCEncodingForType(QualType t, std::string &S) const;
// Put the string version of type qualifiers into S.
- void getObjcEncodingForTypeQualifier(Decl::ObjcDeclQualifier QT,
+ void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT,
std::string &S) const;
- /// getObjcEncodingForMethodDecl - Return the encoded type for this method
+ /// getObjCEncodingForMethodDecl - Return the encoded type for this method
/// declaration.
- void getObjcEncodingForMethodDecl(ObjcMethodDecl *Decl, std::string &S);
+ void getObjCEncodingForMethodDecl(ObjCMethodDecl *Decl, std::string &S);
- /// getObjcEncodingTypeSize returns size of type for objective-c encoding
+ /// getObjCEncodingTypeSize returns size of type for objective-c encoding
/// purpose.
- int getObjcEncodingTypeSize(QualType t);
+ int getObjCEncodingTypeSize(QualType t);
// This setter/getter repreents the ObjC 'id' type. It is setup lazily, by
// Sema.
- void setObjcIdType(TypedefDecl *Decl);
- QualType getObjcIdType() const { return ObjcIdType; }
+ void setObjCIdType(TypedefDecl *Decl);
+ QualType getObjCIdType() const { return ObjCIdType; }
- void setObjcSelType(TypedefDecl *Decl);
- QualType getObjcSelType() const { return ObjcSelType; }
+ void setObjCSelType(TypedefDecl *Decl);
+ QualType getObjCSelType() const { return ObjCSelType; }
- void setObjcProtoType(QualType QT);
- QualType getObjcProtoType() const { return ObjcProtoType; }
+ void setObjCProtoType(QualType QT);
+ QualType getObjCProtoType() const { return ObjCProtoType; }
- void setObjcClassType(TypedefDecl *Decl);
- QualType getObjcClassType() const { return ObjcClassType; }
+ void setObjCClassType(TypedefDecl *Decl);
+ QualType getObjCClassType() const { return ObjCClassType; }
void setBuiltinVaListType(QualType T);
QualType getBuiltinVaListType() const { return BuiltinVaListType; }
@@ -295,20 +295,20 @@
bool vectorTypesAreCompatible(QualType, QualType);
bool QualifiedInterfaceTypesAreCompatible(QualType, QualType);
- bool ObjcQualifiedIdTypesAreCompatible(QualType, QualType, bool = false);
+ bool ObjCQualifiedIdTypesAreCompatible(QualType, QualType, bool = false);
bool objcTypesAreCompatible(QualType, QualType);
- bool isObjcIdType(QualType T) const {
+ bool isObjCIdType(QualType T) const {
if (!IdStructType) // ObjC isn't enabled
return false;
return T->getAsStructureType() == IdStructType;
}
- bool isObjcClassType(QualType T) const {
+ bool isObjCClassType(QualType T) const {
if (!ClassStructType) // ObjC isn't enabled
return false;
return T->getAsStructureType() == ClassStructType;
}
- bool isObjcSelType(QualType T) const {
- assert(SelStructType && "isObjcSelType used before 'SEL' type is built");
+ bool isObjCSelType(QualType T) const {
+ assert(SelStructType && "isObjCSelType used before 'SEL' type is built");
return T->getAsStructureType() == SelStructType;
}
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Mon Jan 7 13:49:32 2008
@@ -43,16 +43,16 @@
// Decl
// NamedDecl
Field,
- ObjcIvar,
- ObjcCategory,
- ObjcCategoryImpl,
- ObjcImplementation,
- ObjcProtocol,
+ ObjCIvar,
+ ObjCCategory,
+ ObjCCategoryImpl,
+ ObjCImplementation,
+ ObjCProtocol,
PropertyDecl,
// ScopedDecl
CompatibleAlias,
// TypeDecl
- ObjcInterface,
+ ObjCInterface,
Typedef,
// TagDecl
Enum,
@@ -67,16 +67,16 @@
BlockVar,
FileVar,
ParmVar,
- ObjcMethod,
- ObjcClass,
- ObjcForwardProtocol,
+ ObjCMethod,
+ ObjCClass,
+ ObjCForwardProtocol,
// For each non-leaf class, we now define a mapping to the first/last member
// of the class, to allow efficient classof.
NamedFirst = Field, NamedLast = ParmVar,
- FieldFirst = Field, FieldLast = ObjcIvar,
+ FieldFirst = Field, FieldLast = ObjCIvar,
ScopedFirst = CompatibleAlias, ScopedLast = ParmVar,
- TypeFirst = ObjcInterface, TypeLast = Class,
+ TypeFirst = ObjCInterface, TypeLast = Class,
TagFirst = Enum , TagLast = Class,
RecordFirst = Struct , RecordLast = Class,
ValueFirst = EnumConstant , ValueLast = ParmVar,
@@ -92,10 +92,10 @@
IDNS_Ordinary
};
- /// ObjcDeclQualifier - Qualifier used on types in method declarations
+ /// ObjCDeclQualifier - Qualifier used on types in method declarations
/// for remote messaging. They are meant for the arguments though and
- /// applied to the Decls (ObjcMethodDecl and ParmVarDecl).
- enum ObjcDeclQualifier {
+ /// applied to the Decls (ObjCMethodDecl and ParmVarDecl).
+ enum ObjCDeclQualifier {
OBJC_TQ_None = 0x0,
OBJC_TQ_In = 0x1,
OBJC_TQ_Inout = 0x2,
@@ -143,7 +143,7 @@
case FileVar:
case ParmVar:
case EnumConstant:
- case ObjcInterface:
+ case ObjCInterface:
case CompatibleAlias:
return IDNS_Ordinary;
case Struct:
@@ -180,7 +180,7 @@
};
/// NamedDecl - This represents a decl with an identifier for a name. Many
-/// decls have names, but not ObjcMethodDecl, @class, etc.
+/// decls have names, but not ObjCMethodDecl, @class, etc.
class NamedDecl : public Decl {
/// Identifier - The identifier for this declaration (e.g. the name for the
/// variable, the tag for a struct).
@@ -396,8 +396,8 @@
: VarDecl(ParmVar, L, Id, T, S, PrevDecl, A),
objcDeclQualifier(OBJC_TQ_None) {}
- ObjcDeclQualifier getObjcDeclQualifier() const { return objcDeclQualifier; }
- void setObjcDeclQualifier(ObjcDeclQualifier QTVal)
+ ObjCDeclQualifier getObjCDeclQualifier() const { return objcDeclQualifier; }
+ void setObjCDeclQualifier(ObjCDeclQualifier QTVal)
{ objcDeclQualifier = QTVal; }
// Implement isa/cast/dyncast/etc.
@@ -407,7 +407,7 @@
private:
/// FIXME: Also can be paced into the bitfields in Decl.
/// in, inout, etc.
- ObjcDeclQualifier objcDeclQualifier : 6;
+ ObjCDeclQualifier objcDeclQualifier : 6;
protected:
/// EmitImpl - Serialize this ParmVarDecl. Called by Decl::Emit.
Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Mon Jan 7 13:49:32 2008
@@ -22,13 +22,13 @@
class Stmt;
class FunctionDecl;
class AttributeList;
-class ObjcIvarDecl;
-class ObjcMethodDecl;
-class ObjcProtocolDecl;
-class ObjcCategoryDecl;
-class ObjcPropertyDecl;
+class ObjCIvarDecl;
+class ObjCMethodDecl;
+class ObjCProtocolDecl;
+class ObjCCategoryDecl;
+class ObjCPropertyDecl;
-/// ObjcMethodDecl - Represents an instance or class method declaration.
+/// ObjCMethodDecl - Represents an instance or class method declaration.
/// ObjC methods can be declared within 4 contexts: class interfaces,
/// categories, protocols, and class implementations. While C++ member
/// functions leverage C syntax, Objective-C method syntax is modeled after
@@ -48,7 +48,7 @@
/// A selector represents a unique name for a method. The selector names for
/// the above methods are setMenu:, menu, replaceSubview:with:, and defaultMenu.
///
-class ObjcMethodDecl : public Decl {
+class ObjCMethodDecl : public Decl {
public:
enum ImplementationControl { None, Required, Optional };
private:
@@ -62,7 +62,7 @@
ImplementationControl DeclImplementation : 2;
/// in, inout, etc.
- ObjcDeclQualifier objcDeclQualifier : 6;
+ ObjCDeclQualifier objcDeclQualifier : 6;
// Context this method is declared in.
NamedDecl *MethodContext;
@@ -87,7 +87,7 @@
Stmt *Body;
ParmVarDecl *SelfDecl;
public:
- ObjcMethodDecl(SourceLocation beginLoc, SourceLocation endLoc,
+ ObjCMethodDecl(SourceLocation beginLoc, SourceLocation endLoc,
Selector SelInfo, QualType T,
Decl *contextDecl,
ParmVarDecl **paramInfo = 0, int numParams=-1,
@@ -95,17 +95,17 @@
bool isVariadic = false,
ImplementationControl impControl = None,
Decl *PrevDecl = 0)
- : Decl(ObjcMethod, beginLoc),
+ : Decl(ObjCMethod, beginLoc),
IsInstance(isInstance), IsVariadic(isVariadic),
DeclImplementation(impControl), objcDeclQualifier(OBJC_TQ_None),
MethodContext(static_cast<NamedDecl*>(contextDecl)),
SelName(SelInfo), MethodDeclType(T),
ParamInfo(paramInfo), NumMethodParams(numParams),
MethodAttrs(M), EndLoc(endLoc), Body(0), SelfDecl(0) {}
- virtual ~ObjcMethodDecl();
+ virtual ~ObjCMethodDecl();
- ObjcDeclQualifier getObjcDeclQualifier() const { return objcDeclQualifier; }
- void setObjcDeclQualifier(ObjcDeclQualifier QV) { objcDeclQualifier = QV; }
+ ObjCDeclQualifier getObjCDeclQualifier() const { return objcDeclQualifier; }
+ void setObjCDeclQualifier(ObjCDeclQualifier QV) { objcDeclQualifier = QV; }
// Location information, modeled after the Stmt API.
SourceLocation getLocStart() const { return getLocation(); }
@@ -113,7 +113,7 @@
NamedDecl *getMethodContext() const { return MethodContext; }
- ObjcInterfaceDecl *const getClassInterface() const;
+ ObjCInterfaceDecl *const getClassInterface() const;
Selector getSelector() const { return SelName; }
QualType getResultType() const { return MethodDeclType; }
@@ -154,11 +154,11 @@
void setSelfDecl(ParmVarDecl *PVD) { SelfDecl = PVD; }
// Implement isa/cast/dyncast/etc.
- static bool classof(const Decl *D) { return D->getKind() == ObjcMethod; }
- static bool classof(const ObjcMethodDecl *D) { return true; }
+ static bool classof(const Decl *D) { return D->getKind() == ObjCMethod; }
+ static bool classof(const ObjCMethodDecl *D) { return true; }
};
-/// ObjcInterfaceDecl - Represents an ObjC class declaration. For example:
+/// ObjCInterfaceDecl - Represents an ObjC class declaration. For example:
///
/// // MostPrimitive declares no super class (not particularly useful).
/// @interface MostPrimitive
@@ -167,7 +167,7 @@
///
/// // NSResponder inherits from NSObject & implements NSCoding (a protocol).
/// @interface NSResponder : NSObject <NSCoding>
-/// { // instance variables are represented by ObjcIvarDecl.
+/// { // instance variables are represented by ObjCIvarDecl.
/// id nextResponder; // nextResponder instance variable.
/// }
/// - (NSResponder *)nextResponder; // return a pointer to NSResponder.
@@ -179,32 +179,32 @@
/// Unlike C++, ObjC is a single-rooted class model. In Cocoa, classes
/// typically inherit from NSObject (an exception is NSProxy).
///
-class ObjcInterfaceDecl : public TypeDecl {
+class ObjCInterfaceDecl : public TypeDecl {
/// Class's super class.
- ObjcInterfaceDecl *SuperClass;
+ ObjCInterfaceDecl *SuperClass;
/// Protocols referenced in interface header declaration
- ObjcProtocolDecl **ReferencedProtocols; // Null if none
+ ObjCProtocolDecl **ReferencedProtocols; // Null if none
unsigned NumReferencedProtocols; // 0 if none
/// Ivars/NumIvars - This is a new[]'d array of pointers to Decls.
- ObjcIvarDecl **Ivars; // Null if not defined.
+ ObjCIvarDecl **Ivars; // Null if not defined.
int NumIvars; // -1 if not defined.
/// instance methods
- ObjcMethodDecl **InstanceMethods; // Null if not defined
+ ObjCMethodDecl **InstanceMethods; // Null if not defined
int NumInstanceMethods; // -1 if not defined
/// class methods
- ObjcMethodDecl **ClassMethods; // Null if not defined
+ ObjCMethodDecl **ClassMethods; // Null if not defined
int NumClassMethods; // -1 if not defined
/// List of categories defined for this class.
- ObjcCategoryDecl *CategoryList;
+ ObjCCategoryDecl *CategoryList;
/// class properties
- ObjcPropertyDecl **PropertyDecl; // Null if no property
+ ObjCPropertyDecl **PropertyDecl; // Null if no property
int NumPropertyDecl; // -1 if no property
bool ForwardDecl:1; // declared with @class.
@@ -213,10 +213,10 @@
SourceLocation EndLoc; // marks the '>', '}', or identifier.
SourceLocation AtEndLoc; // marks the end of the entire interface.
public:
- ObjcInterfaceDecl(SourceLocation atLoc, unsigned numRefProtos,
+ ObjCInterfaceDecl(SourceLocation atLoc, unsigned numRefProtos,
IdentifierInfo *Id, bool FD = false,
bool isInternal = false)
- : TypeDecl(ObjcInterface, atLoc, Id, 0), SuperClass(0),
+ : TypeDecl(ObjCInterface, atLoc, Id, 0), SuperClass(0),
ReferencedProtocols(0), NumReferencedProtocols(0), Ivars(0),
NumIvars(-1),
InstanceMethods(0), NumInstanceMethods(-1),
@@ -229,21 +229,21 @@
// This is necessary when converting a forward declaration to a definition.
void AllocIntfRefProtocols(unsigned numRefProtos) {
if (numRefProtos) {
- ReferencedProtocols = new ObjcProtocolDecl*[numRefProtos];
+ ReferencedProtocols = new ObjCProtocolDecl*[numRefProtos];
memset(ReferencedProtocols, '\0',
- numRefProtos*sizeof(ObjcProtocolDecl*));
+ numRefProtos*sizeof(ObjCProtocolDecl*));
NumReferencedProtocols = numRefProtos;
}
}
- ObjcProtocolDecl **getReferencedProtocols() const {
+ ObjCProtocolDecl **getReferencedProtocols() const {
return ReferencedProtocols;
}
unsigned getNumIntfRefProtocols() const { return NumReferencedProtocols; }
int getNumInstanceVariables() const { return NumIvars; }
- typedef ObjcIvarDecl * const *ivar_iterator;
+ typedef ObjCIvarDecl * const *ivar_iterator;
unsigned ivar_size() const { return NumIvars == -1 ?0 : NumIvars; }
ivar_iterator ivar_begin() const { return Ivars; }
ivar_iterator ivar_end() const { return Ivars + ivar_size();}
@@ -251,45 +251,45 @@
int getNumInstanceMethods() const { return NumInstanceMethods; }
int getNumClassMethods() const { return NumClassMethods; }
- typedef ObjcMethodDecl * const * instmeth_iterator;
+ typedef ObjCMethodDecl * const * instmeth_iterator;
instmeth_iterator instmeth_begin() const { return InstanceMethods; }
instmeth_iterator instmeth_end() const {
return InstanceMethods+(NumInstanceMethods == -1 ? 0 : NumInstanceMethods);
}
- typedef ObjcMethodDecl * const * classmeth_iterator;
+ typedef ObjCMethodDecl * const * classmeth_iterator;
classmeth_iterator classmeth_begin() const { return ClassMethods; }
classmeth_iterator classmeth_end() const {
return ClassMethods+(NumClassMethods == -1 ? 0 : NumClassMethods);
}
- void addInstanceVariablesToClass(ObjcIvarDecl **ivars, unsigned numIvars,
+ void addInstanceVariablesToClass(ObjCIvarDecl **ivars, unsigned numIvars,
SourceLocation RBracLoc);
- void addMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
- ObjcMethodDecl **clsMethods, unsigned numClsMembers,
+ void addMethods(ObjCMethodDecl **insMethods, unsigned numInsMembers,
+ ObjCMethodDecl **clsMethods, unsigned numClsMembers,
SourceLocation AtEnd);
bool isForwardDecl() const { return ForwardDecl; }
void setForwardDecl(bool val) { ForwardDecl = val; }
- void setIntfRefProtocols(unsigned idx, ObjcProtocolDecl *OID) {
+ void setIntfRefProtocols(unsigned idx, ObjCProtocolDecl *OID) {
assert((idx < NumReferencedProtocols) && "index out of range");
ReferencedProtocols[idx] = OID;
}
- ObjcInterfaceDecl *getSuperClass() const { return SuperClass; }
- void setSuperClass(ObjcInterfaceDecl * superCls) { SuperClass = superCls; }
+ ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
+ void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; }
- ObjcCategoryDecl* getCategoryList() const { return CategoryList; }
- void setCategoryList(ObjcCategoryDecl *category) {
+ ObjCCategoryDecl* getCategoryList() const { return CategoryList; }
+ void setCategoryList(ObjCCategoryDecl *category) {
CategoryList = category;
}
- ObjcIvarDecl *lookupInstanceVariable(IdentifierInfo *ivarName,
- ObjcInterfaceDecl *&clsDeclared);
+ ObjCIvarDecl *lookupInstanceVariable(IdentifierInfo *ivarName,
+ ObjCInterfaceDecl *&clsDeclared);
// Get the local instance method declared in this interface.
- ObjcMethodDecl *getInstanceMethod(Selector &Sel) {
+ ObjCMethodDecl *getInstanceMethod(Selector &Sel) {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
I != E; ++I) {
if ((*I)->getSelector() == Sel)
@@ -298,7 +298,7 @@
return 0;
}
// Get the local class method declared in this interface.
- ObjcMethodDecl *getClassMethod(Selector &Sel) {
+ ObjCMethodDecl *getClassMethod(Selector &Sel) {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I) {
if ((*I)->getSelector() == Sel)
@@ -308,8 +308,8 @@
}
// Lookup a method. First, we search locally. If a method isn't
// found, we search referenced protocols and class categories.
- ObjcMethodDecl *lookupInstanceMethod(Selector Sel);
- ObjcMethodDecl *lookupClassMethod(Selector Sel);
+ ObjCMethodDecl *lookupInstanceMethod(Selector Sel);
+ ObjCMethodDecl *lookupClassMethod(Selector Sel);
// Location information, modeled after the Stmt API.
SourceLocation getLocStart() const { return getLocation(); } // '@'interface
@@ -322,22 +322,22 @@
int getNumPropertyDecl() const { return NumPropertyDecl; }
void setNumPropertyDecl(int num) { NumPropertyDecl = num; }
- ObjcPropertyDecl **const getPropertyDecl() const { return PropertyDecl; }
- ObjcPropertyDecl **getPropertyDecl() { return PropertyDecl; }
- void setPropertyDecls(ObjcPropertyDecl **properties) {
+ ObjCPropertyDecl **const getPropertyDecl() const { return PropertyDecl; }
+ ObjCPropertyDecl **getPropertyDecl() { return PropertyDecl; }
+ void setPropertyDecls(ObjCPropertyDecl **properties) {
PropertyDecl = properties;
}
/// ImplicitInterfaceDecl - check that this is an implicitely declared
- /// ObjcInterfaceDecl node. This is for legacy objective-c @implementation
+ /// ObjCInterfaceDecl node. This is for legacy objective-c @implementation
/// declaration without an @interface declaration.
bool ImplicitInterfaceDecl() const { return InternalInterface; }
- static bool classof(const Decl *D) { return D->getKind() == ObjcInterface; }
- static bool classof(const ObjcInterfaceDecl *D) { return true; }
+ static bool classof(const Decl *D) { return D->getKind() == ObjCInterface; }
+ static bool classof(const ObjCInterfaceDecl *D) { return true; }
};
-/// ObjcIvarDecl - Represents an ObjC instance variable. In general, ObjC
+/// ObjCIvarDecl - Represents an ObjC instance variable. In general, ObjC
/// instance variables are identical to C. The only exception is Objective-C
/// supports C++ style access control. For example:
///
@@ -352,10 +352,10 @@
/// id canBePackage; // framework visibility (not available in C++).
/// }
///
-class ObjcIvarDecl : public FieldDecl {
+class ObjCIvarDecl : public FieldDecl {
public:
- ObjcIvarDecl(SourceLocation L, IdentifierInfo *Id, QualType T)
- : FieldDecl(ObjcIvar, L, Id, T) {}
+ ObjCIvarDecl(SourceLocation L, IdentifierInfo *Id, QualType T)
+ : FieldDecl(ObjCIvar, L, Id, T) {}
enum AccessControl {
None, Private, Protected, Public, Package
@@ -364,14 +364,14 @@
AccessControl getAccessControl() const { return DeclAccess; }
// Implement isa/cast/dyncast/etc.
- static bool classof(const Decl *D) { return D->getKind() == ObjcIvar; }
- static bool classof(const ObjcIvarDecl *D) { return true; }
+ static bool classof(const Decl *D) { return D->getKind() == ObjCIvar; }
+ static bool classof(const ObjCIvarDecl *D) { return true; }
private:
AccessControl DeclAccess : 3;
};
-/// ObjcProtocolDecl - Represents a protocol declaration. ObjC protocols
+/// ObjCProtocolDecl - Represents a protocol declaration. ObjC protocols
/// declare a pure abstract type (i.e no instance variables are permitted).
/// Protocols orginally drew inspiration from C++ pure virtual functions (a C++
/// feature with nice semantics and lousy syntax:-). Here is an example:
@@ -384,24 +384,24 @@
/// @interface ImplementsNSDraggingInfo : NSObject <NSDraggingInfo>
/// @end
///
-/// Objc protocols inspired Java interfaces. Unlike Java, ObjC classes and
+/// ObjC protocols inspired Java interfaces. Unlike Java, ObjC classes and
/// protocols are in distinct namespaces. For example, Cocoa defines both
/// an NSObject protocol and class (which isn't allowed in Java). As a result,
/// protocols are referenced using angle brackets as follows:
///
/// id <NSDraggingInfo> anyObjectThatImplementsNSDraggingInfo;
///
-class ObjcProtocolDecl : public NamedDecl {
+class ObjCProtocolDecl : public NamedDecl {
/// referenced protocols
- ObjcProtocolDecl **ReferencedProtocols; // Null if none
+ ObjCProtocolDecl **ReferencedProtocols; // Null if none
unsigned NumReferencedProtocols; // 0 if none
/// protocol instance methods
- ObjcMethodDecl **InstanceMethods; // Null if not defined
+ ObjCMethodDecl **InstanceMethods; // Null if not defined
int NumInstanceMethods; // -1 if not defined
/// protocol class methods
- ObjcMethodDecl **ClassMethods; // Null if not defined
+ ObjCMethodDecl **ClassMethods; // Null if not defined
int NumClassMethods; // -1 if not defined
bool isForwardProtoDecl; // declared with @protocol.
@@ -409,9 +409,9 @@
SourceLocation EndLoc; // marks the '>' or identifier.
SourceLocation AtEndLoc; // marks the end of the entire interface.
public:
- ObjcProtocolDecl(SourceLocation L, unsigned numRefProtos,
+ ObjCProtocolDecl(SourceLocation L, unsigned numRefProtos,
IdentifierInfo *Id, bool FD = false)
- : NamedDecl(ObjcProtocol, L, Id),
+ : NamedDecl(ObjCProtocol, L, Id),
ReferencedProtocols(0), NumReferencedProtocols(0),
InstanceMethods(0), NumInstanceMethods(-1),
ClassMethods(0), NumClassMethods(-1),
@@ -420,42 +420,42 @@
}
void AllocReferencedProtocols(unsigned numRefProtos) {
if (numRefProtos) {
- ReferencedProtocols = new ObjcProtocolDecl*[numRefProtos];
+ ReferencedProtocols = new ObjCProtocolDecl*[numRefProtos];
memset(ReferencedProtocols, '\0',
- numRefProtos*sizeof(ObjcProtocolDecl*));
+ numRefProtos*sizeof(ObjCProtocolDecl*));
NumReferencedProtocols = numRefProtos;
}
}
- void addMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
- ObjcMethodDecl **clsMethods, unsigned numClsMembers,
+ void addMethods(ObjCMethodDecl **insMethods, unsigned numInsMembers,
+ ObjCMethodDecl **clsMethods, unsigned numClsMembers,
SourceLocation AtEndLoc);
- void setReferencedProtocols(unsigned idx, ObjcProtocolDecl *OID) {
+ void setReferencedProtocols(unsigned idx, ObjCProtocolDecl *OID) {
assert((idx < NumReferencedProtocols) && "index out of range");
ReferencedProtocols[idx] = OID;
}
- ObjcProtocolDecl** getReferencedProtocols() const {
+ ObjCProtocolDecl** getReferencedProtocols() const {
return ReferencedProtocols;
}
unsigned getNumReferencedProtocols() const { return NumReferencedProtocols; }
int getNumInstanceMethods() const { return NumInstanceMethods; }
int getNumClassMethods() const { return NumClassMethods; }
- typedef ObjcMethodDecl * const * instmeth_iterator;
+ typedef ObjCMethodDecl * const * instmeth_iterator;
instmeth_iterator instmeth_begin() const { return InstanceMethods; }
instmeth_iterator instmeth_end() const {
return InstanceMethods+(NumInstanceMethods == -1 ? 0 : NumInstanceMethods);
}
- typedef ObjcMethodDecl * const * classmeth_iterator;
+ typedef ObjCMethodDecl * const * classmeth_iterator;
classmeth_iterator classmeth_begin() const { return ClassMethods; }
classmeth_iterator classmeth_end() const {
return ClassMethods+(NumClassMethods == -1 ? 0 : NumClassMethods);
}
// Get the local instance method declared in this interface.
- ObjcMethodDecl *getInstanceMethod(Selector &Sel) {
+ ObjCMethodDecl *getInstanceMethod(Selector &Sel) {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
I != E; ++I) {
if ((*I)->getSelector() == Sel)
@@ -464,7 +464,7 @@
return 0;
}
// Get the local class method declared in this interface.
- ObjcMethodDecl *getClassMethod(Selector &Sel) {
+ ObjCMethodDecl *getClassMethod(Selector &Sel) {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I) {
if ((*I)->getSelector() == Sel)
@@ -475,8 +475,8 @@
// Lookup a method. First, we search locally. If a method isn't
// found, we search referenced protocols and class categories.
- ObjcMethodDecl *lookupInstanceMethod(Selector Sel);
- ObjcMethodDecl *lookupClassMethod(Selector Sel);
+ ObjCMethodDecl *lookupInstanceMethod(Selector Sel);
+ ObjCMethodDecl *lookupClassMethod(Selector Sel);
bool isForwardDecl() const { return isForwardProtoDecl; }
void setForwardDecl(bool val) { isForwardProtoDecl = val; }
@@ -489,82 +489,82 @@
// We also need to record the @end location.
SourceLocation getAtEndLoc() const { return AtEndLoc; }
- static bool classof(const Decl *D) { return D->getKind() == ObjcProtocol; }
- static bool classof(const ObjcProtocolDecl *D) { return true; }
+ static bool classof(const Decl *D) { return D->getKind() == ObjCProtocol; }
+ static bool classof(const ObjCProtocolDecl *D) { return true; }
};
-/// ObjcClassDecl - Specifies a list of forward class declarations. For example:
+/// ObjCClassDecl - Specifies a list of forward class declarations. For example:
///
/// @class NSCursor, NSImage, NSPasteboard, NSWindow;
///
-class ObjcClassDecl : public Decl {
- ObjcInterfaceDecl **ForwardDecls;
+class ObjCClassDecl : public Decl {
+ ObjCInterfaceDecl **ForwardDecls;
unsigned NumForwardDecls;
public:
- ObjcClassDecl(SourceLocation L, ObjcInterfaceDecl **Elts, unsigned nElts)
- : Decl(ObjcClass, L) {
+ ObjCClassDecl(SourceLocation L, ObjCInterfaceDecl **Elts, unsigned nElts)
+ : Decl(ObjCClass, L) {
if (nElts) {
- ForwardDecls = new ObjcInterfaceDecl*[nElts];
- memcpy(ForwardDecls, Elts, nElts*sizeof(ObjcInterfaceDecl*));
+ ForwardDecls = new ObjCInterfaceDecl*[nElts];
+ memcpy(ForwardDecls, Elts, nElts*sizeof(ObjCInterfaceDecl*));
} else {
ForwardDecls = 0;
}
NumForwardDecls = nElts;
}
- void setInterfaceDecl(unsigned idx, ObjcInterfaceDecl *OID) {
+ void setInterfaceDecl(unsigned idx, ObjCInterfaceDecl *OID) {
assert(idx < NumForwardDecls && "index out of range");
ForwardDecls[idx] = OID;
}
- ObjcInterfaceDecl** getForwardDecls() const { return ForwardDecls; }
+ ObjCInterfaceDecl** getForwardDecls() const { return ForwardDecls; }
int getNumForwardDecls() const { return NumForwardDecls; }
- static bool classof(const Decl *D) { return D->getKind() == ObjcClass; }
- static bool classof(const ObjcClassDecl *D) { return true; }
+ static bool classof(const Decl *D) { return D->getKind() == ObjCClass; }
+ static bool classof(const ObjCClassDecl *D) { return true; }
};
-/// ObjcForwardProtocolDecl - Specifies a list of forward protocol declarations.
+/// ObjCForwardProtocolDecl - Specifies a list of forward protocol declarations.
/// For example:
///
/// @protocol NSTextInput, NSChangeSpelling, NSDraggingInfo;
///
-class ObjcForwardProtocolDecl : public Decl {
- ObjcProtocolDecl **ReferencedProtocols;
+class ObjCForwardProtocolDecl : public Decl {
+ ObjCProtocolDecl **ReferencedProtocols;
unsigned NumReferencedProtocols;
public:
- ObjcForwardProtocolDecl(SourceLocation L,
- ObjcProtocolDecl **Elts, unsigned nElts)
- : Decl(ObjcForwardProtocol, L) {
+ ObjCForwardProtocolDecl(SourceLocation L,
+ ObjCProtocolDecl **Elts, unsigned nElts)
+ : Decl(ObjCForwardProtocol, L) {
NumReferencedProtocols = nElts;
if (nElts) {
- ReferencedProtocols = new ObjcProtocolDecl*[nElts];
- memcpy(ReferencedProtocols, Elts, nElts*sizeof(ObjcProtocolDecl*));
+ ReferencedProtocols = new ObjCProtocolDecl*[nElts];
+ memcpy(ReferencedProtocols, Elts, nElts*sizeof(ObjCProtocolDecl*));
} else {
ReferencedProtocols = 0;
}
}
- void setForwardProtocolDecl(unsigned idx, ObjcProtocolDecl *OID) {
+ void setForwardProtocolDecl(unsigned idx, ObjCProtocolDecl *OID) {
assert(idx < NumReferencedProtocols && "index out of range");
ReferencedProtocols[idx] = OID;
}
unsigned getNumForwardDecls() const { return NumReferencedProtocols; }
- ObjcProtocolDecl *getForwardProtocolDecl(unsigned idx) {
+ ObjCProtocolDecl *getForwardProtocolDecl(unsigned idx) {
assert(idx < NumReferencedProtocols && "index out of range");
return ReferencedProtocols[idx];
}
- const ObjcProtocolDecl *getForwardProtocolDecl(unsigned idx) const {
+ const ObjCProtocolDecl *getForwardProtocolDecl(unsigned idx) const {
assert(idx < NumReferencedProtocols && "index out of range");
return ReferencedProtocols[idx];
}
static bool classof(const Decl *D) {
- return D->getKind() == ObjcForwardProtocol;
+ return D->getKind() == ObjCForwardProtocol;
}
- static bool classof(const ObjcForwardProtocolDecl *D) { return true; }
+ static bool classof(const ObjCForwardProtocolDecl *D) { return true; }
};
-/// ObjcCategoryDecl - Represents a category declaration. A category allows
+/// ObjCCategoryDecl - Represents a category declaration. A category allows
/// you to add methods to an existing class (without subclassing or modifying
/// the original class interface or implementation:-). Categories don't allow
/// you to add instance data. The following example adds "myMethod" to all
@@ -581,71 +581,71 @@
/// Lisp and Smalltalk. More traditional class-based languages (C++, Java)
/// don't support this level of dynamism, which is both powerful and dangerous.
///
-class ObjcCategoryDecl : public NamedDecl {
+class ObjCCategoryDecl : public NamedDecl {
/// Interface belonging to this category
- ObjcInterfaceDecl *ClassInterface;
+ ObjCInterfaceDecl *ClassInterface;
/// referenced protocols in this category
- ObjcProtocolDecl **ReferencedProtocols; // Null if none
+ ObjCProtocolDecl **ReferencedProtocols; // Null if none
unsigned NumReferencedProtocols; // 0 if none
/// category instance methods
- ObjcMethodDecl **InstanceMethods; // Null if not defined
+ ObjCMethodDecl **InstanceMethods; // Null if not defined
int NumInstanceMethods; // -1 if not defined
/// category class methods
- ObjcMethodDecl **ClassMethods; // Null if not defined
+ ObjCMethodDecl **ClassMethods; // Null if not defined
int NumClassMethods; // -1 if not defined
/// Next category belonging to this class
- ObjcCategoryDecl *NextClassCategory;
+ ObjCCategoryDecl *NextClassCategory;
SourceLocation EndLoc; // marks the '>' or identifier.
SourceLocation AtEndLoc; // marks the end of the entire interface.
public:
- ObjcCategoryDecl(SourceLocation L, unsigned numRefProtocol,IdentifierInfo *Id)
- : NamedDecl(ObjcCategory, L, Id),
+ ObjCCategoryDecl(SourceLocation L, unsigned numRefProtocol,IdentifierInfo *Id)
+ : NamedDecl(ObjCCategory, L, Id),
ClassInterface(0), ReferencedProtocols(0), NumReferencedProtocols(0),
InstanceMethods(0), NumInstanceMethods(-1),
ClassMethods(0), NumClassMethods(-1),
NextClassCategory(0) {
if (numRefProtocol) {
- ReferencedProtocols = new ObjcProtocolDecl*[numRefProtocol];
+ ReferencedProtocols = new ObjCProtocolDecl*[numRefProtocol];
memset(ReferencedProtocols, '\0',
- numRefProtocol*sizeof(ObjcProtocolDecl*));
+ numRefProtocol*sizeof(ObjCProtocolDecl*));
NumReferencedProtocols = numRefProtocol;
}
}
- ObjcInterfaceDecl *getClassInterface() const { return ClassInterface; }
- void setClassInterface(ObjcInterfaceDecl *IDecl) { ClassInterface = IDecl; }
+ ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
+ void setClassInterface(ObjCInterfaceDecl *IDecl) { ClassInterface = IDecl; }
- void setCatReferencedProtocols(unsigned idx, ObjcProtocolDecl *OID) {
+ void setCatReferencedProtocols(unsigned idx, ObjCProtocolDecl *OID) {
assert((idx < NumReferencedProtocols) && "index out of range");
ReferencedProtocols[idx] = OID;
}
- ObjcProtocolDecl **getReferencedProtocols() const {
+ ObjCProtocolDecl **getReferencedProtocols() const {
return ReferencedProtocols;
}
unsigned getNumReferencedProtocols() const { return NumReferencedProtocols; }
int getNumInstanceMethods() const { return NumInstanceMethods; }
int getNumClassMethods() const { return NumClassMethods; }
- typedef ObjcMethodDecl * const * instmeth_iterator;
+ typedef ObjCMethodDecl * const * instmeth_iterator;
instmeth_iterator instmeth_begin() const { return InstanceMethods; }
instmeth_iterator instmeth_end() const {
return InstanceMethods+(NumInstanceMethods == -1 ? 0 : NumInstanceMethods);
}
- typedef ObjcMethodDecl * const * classmeth_iterator;
+ typedef ObjCMethodDecl * const * classmeth_iterator;
classmeth_iterator classmeth_begin() const { return ClassMethods; }
classmeth_iterator classmeth_end() const {
return ClassMethods+(NumClassMethods == -1 ? 0 : NumClassMethods);
}
// Get the local instance method declared in this interface.
- ObjcMethodDecl *getInstanceMethod(Selector &Sel) {
+ ObjCMethodDecl *getInstanceMethod(Selector &Sel) {
for (instmeth_iterator I = instmeth_begin(), E = instmeth_end();
I != E; ++I) {
if ((*I)->getSelector() == Sel)
@@ -654,7 +654,7 @@
return 0;
}
// Get the local class method declared in this interface.
- ObjcMethodDecl *getClassMethod(Selector &Sel) {
+ ObjCMethodDecl *getClassMethod(Selector &Sel) {
for (classmeth_iterator I = classmeth_begin(), E = classmeth_end();
I != E; ++I) {
if ((*I)->getSelector() == Sel)
@@ -663,11 +663,11 @@
return 0;
}
- void addMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
- ObjcMethodDecl **clsMethods, unsigned numClsMembers,
+ void addMethods(ObjCMethodDecl **insMethods, unsigned numInsMembers,
+ ObjCMethodDecl **clsMethods, unsigned numClsMembers,
SourceLocation AtEndLoc);
- ObjcCategoryDecl *getNextClassCategory() const { return NextClassCategory; }
+ ObjCCategoryDecl *getNextClassCategory() const { return NextClassCategory; }
void insertNextClassCategory() {
NextClassCategory = ClassInterface->getCategoryList();
ClassInterface->setCategoryList(this);
@@ -680,51 +680,51 @@
// We also need to record the @end location.
SourceLocation getAtEndLoc() const { return AtEndLoc; }
- static bool classof(const Decl *D) { return D->getKind() == ObjcCategory; }
- static bool classof(const ObjcCategoryDecl *D) { return true; }
+ static bool classof(const Decl *D) { return D->getKind() == ObjCCategory; }
+ static bool classof(const ObjCCategoryDecl *D) { return true; }
};
-/// ObjcCategoryImplDecl - An object of this class encapsulates a category
+/// ObjCCategoryImplDecl - An object of this class encapsulates a category
/// @implementation declaration.
-class ObjcCategoryImplDecl : public NamedDecl {
+class ObjCCategoryImplDecl : public NamedDecl {
/// Class interface for this category implementation
- ObjcInterfaceDecl *ClassInterface;
+ ObjCInterfaceDecl *ClassInterface;
/// implemented instance methods
- llvm::SmallVector<ObjcMethodDecl*, 32> InstanceMethods;
+ llvm::SmallVector<ObjCMethodDecl*, 32> InstanceMethods;
/// implemented class methods
- llvm::SmallVector<ObjcMethodDecl*, 32> ClassMethods;
+ llvm::SmallVector<ObjCMethodDecl*, 32> ClassMethods;
SourceLocation EndLoc;
public:
- ObjcCategoryImplDecl(SourceLocation L, IdentifierInfo *Id,
- ObjcInterfaceDecl *classInterface)
- : NamedDecl(ObjcCategoryImpl, L, Id), ClassInterface(classInterface) {}
+ ObjCCategoryImplDecl(SourceLocation L, IdentifierInfo *Id,
+ ObjCInterfaceDecl *classInterface)
+ : NamedDecl(ObjCCategoryImpl, L, Id), ClassInterface(classInterface) {}
- ObjcInterfaceDecl *getClassInterface() const { return ClassInterface; }
+ ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
unsigned getNumInstanceMethods() const { return InstanceMethods.size(); }
unsigned getNumClassMethods() const { return ClassMethods.size(); }
- void addInstanceMethod(ObjcMethodDecl *method) {
+ void addInstanceMethod(ObjCMethodDecl *method) {
InstanceMethods.push_back(method);
}
- void addClassMethod(ObjcMethodDecl *method) {
+ void addClassMethod(ObjCMethodDecl *method) {
ClassMethods.push_back(method);
}
// Get the instance method definition for this implementation.
- ObjcMethodDecl *getInstanceMethod(Selector Sel);
+ ObjCMethodDecl *getInstanceMethod(Selector Sel);
// Get the class method definition for this implementation.
- ObjcMethodDecl *getClassMethod(Selector Sel);
+ ObjCMethodDecl *getClassMethod(Selector Sel);
- typedef llvm::SmallVector<ObjcMethodDecl*, 32>::const_iterator
+ typedef llvm::SmallVector<ObjCMethodDecl*, 32>::const_iterator
instmeth_iterator;
instmeth_iterator instmeth_begin() const { return InstanceMethods.begin(); }
instmeth_iterator instmeth_end() const { return InstanceMethods.end(); }
- typedef llvm::SmallVector<ObjcMethodDecl*, 32>::const_iterator
+ typedef llvm::SmallVector<ObjCMethodDecl*, 32>::const_iterator
classmeth_iterator;
classmeth_iterator classmeth_begin() const { return ClassMethods.begin(); }
classmeth_iterator classmeth_end() const { return ClassMethods.end(); }
@@ -735,11 +735,11 @@
SourceLocation getLocEnd() const { return EndLoc; }
void setLocEnd(SourceLocation LE) { EndLoc = LE; };
- static bool classof(const Decl *D) { return D->getKind() == ObjcCategoryImpl;}
- static bool classof(const ObjcCategoryImplDecl *D) { return true; }
+ static bool classof(const Decl *D) { return D->getKind() == ObjCCategoryImpl;}
+ static bool classof(const ObjCCategoryImplDecl *D) { return true; }
};
-/// ObjcImplementationDecl - Represents a class definition - this is where
+/// ObjCImplementationDecl - Represents a class definition - this is where
/// method definitions are specified. For example:
///
/// @implementation MyClass
@@ -754,39 +754,39 @@
/// the legacy semantics and allow developers to move private ivar declarations
/// from the class interface to the class implementation (but I digress:-)
///
-class ObjcImplementationDecl : public NamedDecl {
+class ObjCImplementationDecl : public NamedDecl {
/// Class interface for this category implementation
- ObjcInterfaceDecl *ClassInterface;
+ ObjCInterfaceDecl *ClassInterface;
/// Implementation Class's super class.
- ObjcInterfaceDecl *SuperClass;
+ ObjCInterfaceDecl *SuperClass;
/// Optional Ivars/NumIvars - This is a new[]'d array of pointers to Decls.
- ObjcIvarDecl **Ivars; // Null if not specified
+ ObjCIvarDecl **Ivars; // Null if not specified
int NumIvars; // -1 if not defined.
/// implemented instance methods
- llvm::SmallVector<ObjcMethodDecl*, 32> InstanceMethods;
+ llvm::SmallVector<ObjCMethodDecl*, 32> InstanceMethods;
/// implemented class methods
- llvm::SmallVector<ObjcMethodDecl*, 32> ClassMethods;
+ llvm::SmallVector<ObjCMethodDecl*, 32> ClassMethods;
SourceLocation EndLoc;
public:
- ObjcImplementationDecl(SourceLocation L, IdentifierInfo *Id,
- ObjcInterfaceDecl *classInterface,
- ObjcInterfaceDecl *superDecl)
- : NamedDecl(ObjcImplementation, L, Id),
+ ObjCImplementationDecl(SourceLocation L, IdentifierInfo *Id,
+ ObjCInterfaceDecl *classInterface,
+ ObjCInterfaceDecl *superDecl)
+ : NamedDecl(ObjCImplementation, L, Id),
ClassInterface(classInterface), SuperClass(superDecl),
Ivars(0), NumIvars(-1) {}
- void ObjcAddInstanceVariablesToClassImpl(ObjcIvarDecl **ivars,
+ void ObjCAddInstanceVariablesToClassImpl(ObjCIvarDecl **ivars,
unsigned numIvars);
- void addInstanceMethod(ObjcMethodDecl *method) {
+ void addInstanceMethod(ObjCMethodDecl *method) {
InstanceMethods.push_back(method);
}
- void addClassMethod(ObjcMethodDecl *method) {
+ void addClassMethod(ObjCMethodDecl *method) {
ClassMethods.push_back(method);
}
// Location information, modeled after the Stmt API.
@@ -794,10 +794,10 @@
SourceLocation getLocEnd() const { return EndLoc; }
void setLocEnd(SourceLocation LE) { EndLoc = LE; };
- ObjcInterfaceDecl *getClassInterface() const { return ClassInterface; }
- ObjcInterfaceDecl *getSuperClass() const { return SuperClass; }
+ ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
+ ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
- void setSuperClass(ObjcInterfaceDecl * superCls)
+ void setSuperClass(ObjCInterfaceDecl * superCls)
{ SuperClass = superCls; }
int getNumInstanceMethods() const { return InstanceMethods.size(); }
@@ -806,54 +806,54 @@
int getImplDeclNumIvars() const { return NumIvars; }
- typedef llvm::SmallVector<ObjcMethodDecl*, 32>::const_iterator
+ typedef llvm::SmallVector<ObjCMethodDecl*, 32>::const_iterator
instmeth_iterator;
instmeth_iterator instmeth_begin() const { return InstanceMethods.begin(); }
instmeth_iterator instmeth_end() const { return InstanceMethods.end(); }
- typedef llvm::SmallVector<ObjcMethodDecl*, 32>::const_iterator
+ typedef llvm::SmallVector<ObjCMethodDecl*, 32>::const_iterator
classmeth_iterator;
classmeth_iterator classmeth_begin() const { return ClassMethods.begin(); }
classmeth_iterator classmeth_end() const { return ClassMethods.end(); }
// Get the instance method definition for this implementation.
- ObjcMethodDecl *getInstanceMethod(Selector Sel);
+ ObjCMethodDecl *getInstanceMethod(Selector Sel);
// Get the class method definition for this implementation.
- ObjcMethodDecl *getClassMethod(Selector Sel);
+ ObjCMethodDecl *getClassMethod(Selector Sel);
- typedef ObjcIvarDecl * const *ivar_iterator;
+ typedef ObjCIvarDecl * const *ivar_iterator;
ivar_iterator ivar_begin() const { return Ivars; }
ivar_iterator ivar_end() const {return Ivars+(NumIvars == -1 ? 0 : NumIvars);}
static bool classof(const Decl *D) {
- return D->getKind() == ObjcImplementation;
+ return D->getKind() == ObjCImplementation;
}
- static bool classof(const ObjcImplementationDecl *D) { return true; }
+ static bool classof(const ObjCImplementationDecl *D) { return true; }
};
-/// ObjcCompatibleAliasDecl - Represents alias of a class. This alias is
+/// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is
/// declared as @compatibility_alias alias class.
-class ObjcCompatibleAliasDecl : public ScopedDecl {
+class ObjCCompatibleAliasDecl : public ScopedDecl {
/// Class that this is an alias of.
- ObjcInterfaceDecl *AliasedClass;
+ ObjCInterfaceDecl *AliasedClass;
public:
- ObjcCompatibleAliasDecl(SourceLocation L, IdentifierInfo *Id,
- ObjcInterfaceDecl* aliasedClass)
+ ObjCCompatibleAliasDecl(SourceLocation L, IdentifierInfo *Id,
+ ObjCInterfaceDecl* aliasedClass)
: ScopedDecl(CompatibleAlias, L, Id, 0),
AliasedClass(aliasedClass) {}
- ObjcInterfaceDecl *getClassInterface() const { return AliasedClass; }
+ ObjCInterfaceDecl *getClassInterface() const { return AliasedClass; }
static bool classof(const Decl *D) {
return D->getKind() == CompatibleAlias;
}
- static bool classof(const ObjcCompatibleAliasDecl *D) { return true; }
+ static bool classof(const ObjCCompatibleAliasDecl *D) { return true; }
};
-class ObjcPropertyDecl : public Decl {
+class ObjCPropertyDecl : public Decl {
public:
enum PropertyAttributeKind { OBJC_PR_noattr = 0x0,
OBJC_PR_readonly = 0x01,
@@ -867,7 +867,7 @@
private:
// List of property name declarations
// FIXME: Property is not an ivar.
- ObjcIvarDecl **PropertyDecls;
+ ObjCIvarDecl **PropertyDecls;
int NumPropertyDecls;
PropertyAttributeKind PropertyAttributes : 8;
@@ -876,13 +876,13 @@
IdentifierInfo *SetterName; // setter name of NULL if no setter
public:
- ObjcPropertyDecl(SourceLocation L)
+ ObjCPropertyDecl(SourceLocation L)
: Decl(PropertyDecl, L),
PropertyDecls(0), NumPropertyDecls(-1), PropertyAttributes(OBJC_PR_noattr),
GetterName(0), SetterName(0) {}
- ObjcIvarDecl **const getPropertyDecls() const { return PropertyDecls; }
- void setPropertyDecls(ObjcIvarDecl **property) { PropertyDecls = property; }
+ ObjCIvarDecl **const getPropertyDecls() const { return PropertyDecls; }
+ void setPropertyDecls(ObjCIvarDecl **property) { PropertyDecls = property; }
const int getNumPropertyDecls() const { return NumPropertyDecls; }
void setNumPropertyDecls(int num) { NumPropertyDecls = num; }
@@ -905,7 +905,7 @@
static bool classof(const Decl *D) {
return D->getKind() == PropertyDecl;
}
- static bool classof(const ObjcPropertyDecl *D) { return true; }
+ static bool classof(const ObjCPropertyDecl *D) { return true; }
};
} // end namespace clang
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Mon Jan 7 13:49:32 2008
@@ -1283,15 +1283,15 @@
/// ObjCProtocolExpr used for protocol in Objective-C.
class ObjCProtocolExpr : public Expr {
- ObjcProtocolDecl *Protocol;
+ ObjCProtocolDecl *Protocol;
SourceLocation AtLoc, RParenLoc;
public:
- ObjCProtocolExpr(QualType T, ObjcProtocolDecl *protocol,
+ ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol,
SourceLocation at, SourceLocation rp)
: Expr(ObjCProtocolExprClass, T), Protocol(protocol),
AtLoc(at), RParenLoc(rp) {}
- ObjcProtocolDecl *getProtocol() const { return Protocol; }
+ ObjCProtocolDecl *getProtocol() const { return Protocol; }
SourceLocation getAtLoc() const { return AtLoc; }
SourceLocation getRParenLoc() const { return RParenLoc; }
@@ -1309,20 +1309,20 @@
/// ObjCIvarRefExpr - A reference to an ObjC instance variable.
class ObjCIvarRefExpr : public Expr {
- class ObjcIvarDecl *D;
+ class ObjCIvarDecl *D;
SourceLocation Loc;
Expr *Base;
bool IsArrow:1; // True if this is "X->F", false if this is "X.F".
bool IsFreeIvar:1; // True if ivar reference has no base (self assumed).
public:
- ObjCIvarRefExpr(ObjcIvarDecl *d, QualType t, SourceLocation l, Expr *base=0,
+ ObjCIvarRefExpr(ObjCIvarDecl *d, QualType t, SourceLocation l, Expr *base=0,
bool arrow = false, bool freeIvar = false) :
Expr(ObjCIvarRefExprClass, t), D(d), Loc(l), Base(base), IsArrow(arrow),
IsFreeIvar(freeIvar) {}
- ObjcIvarDecl *getDecl() { return D; }
- const ObjcIvarDecl *getDecl() const { return D; }
+ ObjCIvarDecl *getDecl() { return D; }
+ const ObjCIvarDecl *getDecl() const { return D; }
virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
Expr *const getBase() const { return Base; }
const bool isArrow() const { return IsArrow; }
@@ -1356,7 +1356,7 @@
// A method prototype for this message (optional).
// FIXME: Since method decls contain the selector, and most messages have a
// prototype, consider devising a scheme for unifying SelName/MethodProto.
- ObjcMethodDecl *MethodProto;
+ ObjCMethodDecl *MethodProto;
IdentifierInfo *ClassName; // optional - 0 for instance messages.
@@ -1365,12 +1365,12 @@
// constructor for class messages.
// FIXME: clsName should be typed to ObjCInterfaceType
ObjCMessageExpr(IdentifierInfo *clsName, Selector selInfo,
- QualType retType, ObjcMethodDecl *methDecl,
+ QualType retType, ObjCMethodDecl *methDecl,
SourceLocation LBrac, SourceLocation RBrac,
Expr **ArgExprs, unsigned NumArgs);
// constructor for instance messages.
ObjCMessageExpr(Expr *receiver, Selector selInfo,
- QualType retType, ObjcMethodDecl *methDecl,
+ QualType retType, ObjCMethodDecl *methDecl,
SourceLocation LBrac, SourceLocation RBrac,
Expr **ArgExprs, unsigned NumArgs);
~ObjCMessageExpr() {
@@ -1383,8 +1383,8 @@
const Selector &getSelector() const { return SelName; }
Selector &getSelector() { return SelName; }
- const ObjcMethodDecl *getMethodDecl() const { return MethodProto; }
- ObjcMethodDecl *getMethodDecl() { return MethodProto; }
+ const ObjCMethodDecl *getMethodDecl() const { return MethodProto; }
+ ObjCMethodDecl *getMethodDecl() { return MethodProto; }
const IdentifierInfo *getClassName() const { return ClassName; }
IdentifierInfo *getClassName() { return ClassName; }
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Mon Jan 7 13:49:32 2008
@@ -573,17 +573,17 @@
static ForStmt* CreateImpl(llvm::Deserializer& D);
};
-/// ObjcForCollectionStmt - This represents Objective-c's collection statement;
+/// ObjCForCollectionStmt - This represents Objective-c's collection statement;
/// represented as 'for (element 'in' collection-expression)' stmt.
///
-class ObjcForCollectionStmt : public Stmt {
+class ObjCForCollectionStmt : public Stmt {
enum { ELEM, COLLECTION, BODY, END_EXPR };
Stmt* SubExprs[END_EXPR]; // SubExprs[ELEM] is an expression or declstmt.
SourceLocation ForLoc;
public:
- ObjcForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body,
+ ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body,
SourceLocation FCL)
- : Stmt(ObjcForCollectionStmtClass) {
+ : Stmt(ObjCForCollectionStmtClass) {
SubExprs[ELEM] = Elem;
SubExprs[COLLECTION] = reinterpret_cast<Stmt*>(Collect);
SubExprs[BODY] = Body;
@@ -606,16 +606,16 @@
return SourceRange(ForLoc, SubExprs[BODY]->getLocEnd());
}
static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjcForCollectionStmtClass;
+ return T->getStmtClass() == ObjCForCollectionStmtClass;
}
- static bool classof(const ObjcForCollectionStmt *) { return true; }
+ static bool classof(const ObjCForCollectionStmt *) { return true; }
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
virtual void EmitImpl(llvm::Serializer& S) const;
- static ObjcForCollectionStmt* CreateImpl(llvm::Deserializer& D);
+ static ObjCForCollectionStmt* CreateImpl(llvm::Deserializer& D);
};
/// GotoStmt - This represents a direct goto.
@@ -819,30 +819,30 @@
static AsmStmt* CreateImpl(llvm::Deserializer& D);
};
-/// ObjcAtCatchStmt - This represents objective-c's @catch statement.
-class ObjcAtCatchStmt : public Stmt {
+/// ObjCAtCatchStmt - This represents objective-c's @catch statement.
+class ObjCAtCatchStmt : public Stmt {
private:
// Points to next @catch statement, or null
- ObjcAtCatchStmt *NextAtCatchStmt;
+ ObjCAtCatchStmt *NextAtCatchStmt;
enum { SELECTOR, BODY, END_EXPR };
Stmt *SubExprs[END_EXPR];
SourceLocation AtCatchLoc, RParenLoc;
// Used by deserialization.
- ObjcAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc)
- : Stmt(ObjcAtCatchStmtClass), AtCatchLoc(atCatchLoc), RParenLoc(rparenloc) {}
+ ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc)
+ : Stmt(ObjCAtCatchStmtClass), AtCatchLoc(atCatchLoc), RParenLoc(rparenloc) {}
public:
- ObjcAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc,
+ ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc,
Stmt *catchVarStmtDecl, Stmt *atCatchStmt, Stmt *atCatchList)
- : Stmt(ObjcAtCatchStmtClass) {
+ : Stmt(ObjCAtCatchStmtClass) {
SubExprs[SELECTOR] = catchVarStmtDecl;
SubExprs[BODY] = atCatchStmt;
if (!atCatchList)
NextAtCatchStmt = NULL;
else {
- ObjcAtCatchStmt *AtCatchList =
- static_cast<ObjcAtCatchStmt*>(atCatchList);
+ ObjCAtCatchStmt *AtCatchList =
+ static_cast<ObjCAtCatchStmt*>(atCatchList);
while (AtCatchList->NextAtCatchStmt)
AtCatchList = AtCatchList->NextAtCatchStmt;
AtCatchList->NextAtCatchStmt = this;
@@ -853,8 +853,8 @@
const Stmt *getCatchBody() const { return SubExprs[BODY]; }
Stmt *getCatchBody() { return SubExprs[BODY]; }
- const ObjcAtCatchStmt *getNextCatchStmt() const { return NextAtCatchStmt; }
- ObjcAtCatchStmt *getNextCatchStmt() { return NextAtCatchStmt; }
+ const ObjCAtCatchStmt *getNextCatchStmt() const { return NextAtCatchStmt; }
+ ObjCAtCatchStmt *getNextCatchStmt() { return NextAtCatchStmt; }
const Stmt *getCatchParamStmt() const { return SubExprs[SELECTOR]; }
Stmt *getCatchParamStmt() { return SubExprs[SELECTOR]; }
@@ -865,24 +865,24 @@
}
static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjcAtCatchStmtClass;
+ return T->getStmtClass() == ObjCAtCatchStmtClass;
}
- static bool classof(const ObjcAtCatchStmt *) { return true; }
+ static bool classof(const ObjCAtCatchStmt *) { return true; }
virtual child_iterator child_begin();
virtual child_iterator child_end();
virtual void EmitImpl(llvm::Serializer& S) const;
- static ObjcAtCatchStmt* CreateImpl(llvm::Deserializer& D);
+ static ObjCAtCatchStmt* CreateImpl(llvm::Deserializer& D);
};
-/// ObjcAtFinallyStmt - This represent objective-c's @finally Statement
-class ObjcAtFinallyStmt : public Stmt {
+/// ObjCAtFinallyStmt - This represent objective-c's @finally Statement
+class ObjCAtFinallyStmt : public Stmt {
Stmt *AtFinallyStmt;
SourceLocation AtFinallyLoc;
public:
- ObjcAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
- : Stmt(ObjcAtFinallyStmtClass),
+ ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
+ : Stmt(ObjCAtFinallyStmtClass),
AtFinallyStmt(atFinallyStmt), AtFinallyLoc(atFinallyLoc) {}
const Stmt *getFinallyBody () const { return AtFinallyStmt; }
@@ -893,30 +893,30 @@
}
static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjcAtFinallyStmtClass;
+ return T->getStmtClass() == ObjCAtFinallyStmtClass;
}
- static bool classof(const ObjcAtFinallyStmt *) { return true; }
+ static bool classof(const ObjCAtFinallyStmt *) { return true; }
virtual child_iterator child_begin();
virtual child_iterator child_end();
virtual void EmitImpl(llvm::Serializer& S) const;
- static ObjcAtFinallyStmt* CreateImpl(llvm::Deserializer& D);
+ static ObjCAtFinallyStmt* CreateImpl(llvm::Deserializer& D);
};
-/// ObjcAtTryStmt - This represent objective-c's over-all
+/// ObjCAtTryStmt - This represent objective-c's over-all
/// @try ... @catch ... @finally statement.
-class ObjcAtTryStmt : public Stmt {
+class ObjCAtTryStmt : public Stmt {
private:
enum { TRY, CATCH, FINALLY, END_EXPR };
Stmt* SubStmts[END_EXPR];
SourceLocation AtTryLoc;
public:
- ObjcAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
+ ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
Stmt *atCatchStmt,
Stmt *atFinallyStmt)
- : Stmt(ObjcAtTryStmtClass) {
+ : Stmt(ObjCAtTryStmtClass) {
SubStmts[TRY] = atTryStmt;
SubStmts[CATCH] = atCatchStmt;
SubStmts[FINALLY] = atFinallyStmt;
@@ -925,41 +925,41 @@
const Stmt *getTryBody() const { return SubStmts[TRY]; }
Stmt *getTryBody() { return SubStmts[TRY]; }
- const ObjcAtCatchStmt *getCatchStmts() const {
- return dyn_cast_or_null<ObjcAtCatchStmt>(SubStmts[CATCH]);
+ const ObjCAtCatchStmt *getCatchStmts() const {
+ return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]);
}
- ObjcAtCatchStmt *getCatchStmts() {
- return dyn_cast_or_null<ObjcAtCatchStmt>(SubStmts[CATCH]);
+ ObjCAtCatchStmt *getCatchStmts() {
+ return dyn_cast_or_null<ObjCAtCatchStmt>(SubStmts[CATCH]);
}
- const ObjcAtFinallyStmt *getFinallyStmt() const {
- return dyn_cast_or_null<ObjcAtFinallyStmt>(SubStmts[FINALLY]);
+ const ObjCAtFinallyStmt *getFinallyStmt() const {
+ return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]);
}
- ObjcAtFinallyStmt *getFinallyStmt() {
- return dyn_cast_or_null<ObjcAtFinallyStmt>(SubStmts[FINALLY]);
+ ObjCAtFinallyStmt *getFinallyStmt() {
+ return dyn_cast_or_null<ObjCAtFinallyStmt>(SubStmts[FINALLY]);
}
virtual SourceRange getSourceRange() const {
return SourceRange(AtTryLoc, SubStmts[TRY]->getLocEnd());
}
static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjcAtTryStmtClass;
+ return T->getStmtClass() == ObjCAtTryStmtClass;
}
- static bool classof(const ObjcAtTryStmt *) { return true; }
+ static bool classof(const ObjCAtTryStmt *) { return true; }
virtual child_iterator child_begin();
virtual child_iterator child_end();
virtual void EmitImpl(llvm::Serializer& S) const;
- static ObjcAtTryStmt* CreateImpl(llvm::Deserializer& D);
+ static ObjCAtTryStmt* CreateImpl(llvm::Deserializer& D);
};
-/// ObjcAtThrowStmt - This represents objective-c's @throw statement.
-class ObjcAtThrowStmt : public Stmt {
+/// ObjCAtThrowStmt - This represents objective-c's @throw statement.
+class ObjCAtThrowStmt : public Stmt {
Stmt *Throw;
SourceLocation AtThrowLoc;
public:
- ObjcAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
- : Stmt(ObjcAtThrowStmtClass), Throw(throwExpr) {
+ ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
+ : Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
AtThrowLoc = atThrowLoc;
}
@@ -970,15 +970,15 @@
}
static bool classof(const Stmt *T) {
- return T->getStmtClass() == ObjcAtThrowStmtClass;
+ return T->getStmtClass() == ObjCAtThrowStmtClass;
}
- static bool classof(const ObjcAtThrowStmt *) { return true; }
+ static bool classof(const ObjCAtThrowStmt *) { return true; }
virtual child_iterator child_begin();
virtual child_iterator child_end();
virtual void EmitImpl(llvm::Serializer& S) const;
- static ObjcAtThrowStmt* CreateImpl(llvm::Deserializer& D);
+ static ObjCAtThrowStmt* CreateImpl(llvm::Deserializer& D);
};
} // end namespace clang
Modified: cfe/trunk/include/clang/AST/StmtNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtNodes.def?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtNodes.def (original)
+++ cfe/trunk/include/clang/AST/StmtNodes.def Mon Jan 7 13:49:32 2008
@@ -45,12 +45,12 @@
STMT(18, AsmStmt , Stmt)
// Obj-C statements
-STMT(19, ObjcAtTryStmt , Stmt)
-STMT(20, ObjcAtCatchStmt , Stmt)
-STMT(21, ObjcAtFinallyStmt , Stmt)
-STMT(22, ObjcAtThrowStmt , Stmt)
+STMT(19, ObjCAtTryStmt , Stmt)
+STMT(20, ObjCAtCatchStmt , Stmt)
+STMT(21, ObjCAtFinallyStmt , Stmt)
+STMT(22, ObjCAtThrowStmt , Stmt)
// Obj-C2 statements
-STMT(23, ObjcForCollectionStmt, Stmt)
+STMT(23, ObjCForCollectionStmt, Stmt)
LAST_STMT(23)
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Mon Jan 7 13:49:32 2008
@@ -33,9 +33,9 @@
class RecordDecl;
class EnumDecl;
class FieldDecl;
- class ObjcInterfaceDecl;
- class ObjcProtocolDecl;
- class ObjcMethodDecl;
+ class ObjCInterfaceDecl;
+ class ObjCProtocolDecl;
+ class ObjCMethodDecl;
class Expr;
class SourceLocation;
class PointerType;
@@ -50,7 +50,7 @@
class FunctionType;
class OCUVectorType;
class BuiltinType;
- class ObjcQualifiedInterfaceType;
+ class ObjCQualifiedInterfaceType;
class StmtIteratorBase;
/// QualType - For efficiency, we don't store CVR-qualified types as nodes on
@@ -219,8 +219,8 @@
Vector, OCUVector,
FunctionNoProto, FunctionProto,
TypeName, Tagged,
- ObjcInterface, ObjcQualifiedInterface,
- ObjcQualifiedId,
+ ObjCInterface, ObjCQualifiedInterface,
+ ObjCQualifiedId,
TypeOfExp, TypeOfTyp // GNU typeof extension.
};
private:
@@ -294,8 +294,8 @@
bool isUnionType() const;
bool isVectorType() const; // GCC vector type.
bool isOCUVectorType() const; // OCU vector type.
- bool isObjcInterfaceType() const; // includes conforming protocol type
- bool isObjcQualifiedIdType() const; // id includes conforming protocol type
+ bool isObjCInterfaceType() const; // includes conforming protocol type
+ bool isObjCQualifiedIdType() const; // id includes conforming protocol type
// Type Checking Functions: Check to see if this type is structurally the
// specified type, ignoring typedefs, and return a pointer to the best type
@@ -901,83 +901,83 @@
friend class Type;
};
-class ObjcInterfaceType : public Type {
- ObjcInterfaceDecl *Decl;
+class ObjCInterfaceType : public Type {
+ ObjCInterfaceDecl *Decl;
protected:
- ObjcInterfaceType(TypeClass tc, ObjcInterfaceDecl *D) :
+ ObjCInterfaceType(TypeClass tc, ObjCInterfaceDecl *D) :
Type(tc, QualType()), Decl(D) { }
friend class ASTContext; // ASTContext creates these.
public:
- ObjcInterfaceDecl *getDecl() const { return Decl; }
+ ObjCInterfaceDecl *getDecl() const { return Decl; }
virtual void getAsStringInternal(std::string &InnerString) const;
static bool classof(const Type *T) {
- return T->getTypeClass() == ObjcInterface;
+ return T->getTypeClass() == ObjCInterface;
}
- static bool classof(const ObjcInterfaceType *) { return true; }
+ static bool classof(const ObjCInterfaceType *) { return true; }
};
-/// ObjcQualifiedInterfaceType - This class represents interface types
+/// ObjCQualifiedInterfaceType - This class represents interface types
/// conforming to a list of protocols; such as, INTF<Proto1, Proto2, Proto1>.
/// Duplicate protocols are removed and protocol list is canonicalized to be in
/// alphabetical order.
-class ObjcQualifiedInterfaceType : public ObjcInterfaceType,
+class ObjCQualifiedInterfaceType : public ObjCInterfaceType,
public llvm::FoldingSetNode {
// List of protocols for this protocol conforming object type
// List is sorted on protocol name. No protocol is enterred more than once.
- llvm::SmallVector<ObjcProtocolDecl*, 8> Protocols;
+ llvm::SmallVector<ObjCProtocolDecl*, 8> Protocols;
- ObjcQualifiedInterfaceType(ObjcInterfaceDecl *D,
- ObjcProtocolDecl **Protos, unsigned NumP) :
- ObjcInterfaceType(ObjcQualifiedInterface, D),
+ ObjCQualifiedInterfaceType(ObjCInterfaceDecl *D,
+ ObjCProtocolDecl **Protos, unsigned NumP) :
+ ObjCInterfaceType(ObjCQualifiedInterface, D),
Protocols(Protos, Protos+NumP) { }
friend class ASTContext; // ASTContext creates these.
public:
- ObjcProtocolDecl *getProtocols(unsigned i) const {
+ ObjCProtocolDecl *getProtocols(unsigned i) const {
return Protocols[i];
}
unsigned getNumProtocols() const {
return Protocols.size();
}
- ObjcProtocolDecl **getReferencedProtocols() {
+ ObjCProtocolDecl **getReferencedProtocols() {
return &Protocols[0];
}
virtual void getAsStringInternal(std::string &InnerString) const;
void Profile(llvm::FoldingSetNodeID &ID);
static void Profile(llvm::FoldingSetNodeID &ID,
- ObjcProtocolDecl **protocols, unsigned NumProtocols);
+ ObjCProtocolDecl **protocols, unsigned NumProtocols);
static bool classof(const Type *T) {
- return T->getTypeClass() == ObjcQualifiedInterface;
+ return T->getTypeClass() == ObjCQualifiedInterface;
}
- static bool classof(const ObjcQualifiedInterfaceType *) { return true; }
+ static bool classof(const ObjCQualifiedInterfaceType *) { return true; }
};
-/// ObjcQualifiedIdType - to represent id<protocol-list>
-class ObjcQualifiedIdType : public Type,
+/// ObjCQualifiedIdType - to represent id<protocol-list>
+class ObjCQualifiedIdType : public Type,
public llvm::FoldingSetNode {
// List of protocols for this protocol conforming 'id' type
// List is sorted on protocol name. No protocol is enterred more than once.
- llvm::SmallVector<ObjcProtocolDecl*, 8> Protocols;
+ llvm::SmallVector<ObjCProtocolDecl*, 8> Protocols;
- ObjcQualifiedIdType(QualType can, ObjcProtocolDecl **Protos, unsigned NumP)
- : Type(ObjcQualifiedId, can),
+ ObjCQualifiedIdType(QualType can, ObjCProtocolDecl **Protos, unsigned NumP)
+ : Type(ObjCQualifiedId, can),
Protocols(Protos, Protos+NumP) { }
friend class ASTContext; // ASTContext creates these.
public:
- ObjcProtocolDecl *getProtocols(unsigned i) const {
+ ObjCProtocolDecl *getProtocols(unsigned i) const {
return Protocols[i];
}
unsigned getNumProtocols() const {
return Protocols.size();
}
- ObjcProtocolDecl **getReferencedProtocols() {
+ ObjCProtocolDecl **getReferencedProtocols() {
return &Protocols[0];
}
@@ -985,12 +985,12 @@
void Profile(llvm::FoldingSetNodeID &ID);
static void Profile(llvm::FoldingSetNodeID &ID,
- ObjcProtocolDecl **protocols, unsigned NumProtocols);
+ ObjCProtocolDecl **protocols, unsigned NumProtocols);
static bool classof(const Type *T) {
- return T->getTypeClass() == ObjcQualifiedId;
+ return T->getTypeClass() == ObjCQualifiedId;
}
- static bool classof(const ObjcQualifiedIdType *) { return true; }
+ static bool classof(const ObjCQualifiedIdType *) { return true; }
};
@@ -1052,12 +1052,12 @@
inline bool Type::isOCUVectorType() const {
return isa<OCUVectorType>(CanonicalType);
}
-inline bool Type::isObjcInterfaceType() const {
- return isa<ObjcInterfaceType>(CanonicalType)
- || isa<ObjcQualifiedInterfaceType>(CanonicalType);
+inline bool Type::isObjCInterfaceType() const {
+ return isa<ObjCInterfaceType>(CanonicalType)
+ || isa<ObjCQualifiedInterfaceType>(CanonicalType);
}
-inline bool Type::isObjcQualifiedIdType() const {
- return isa<ObjcQualifiedIdType>(CanonicalType);
+inline bool Type::isObjCQualifiedIdType() const {
+ return isa<ObjCQualifiedIdType>(CanonicalType);
}
} // end namespace clang
Modified: cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h (original)
+++ cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h Mon Jan 7 13:49:32 2008
@@ -63,7 +63,7 @@
DISPATCH_CASE(Union,RecordDecl) // FIXME: Refine.
DISPATCH_CASE(Class,RecordDecl) // FIXME: Refine.
DISPATCH_CASE(Enum,EnumDecl)
- DISPATCH_CASE(ObjcInterface,ObjcInterfaceDecl)
+ DISPATCH_CASE(ObjCInterface,ObjCInterfaceDecl)
default:
assert(false && "Subtype of ScopedDecl not handled.");
}
@@ -78,11 +78,11 @@
DEFAULT_DISPATCH(TypedefDecl)
DEFAULT_DISPATCH(RecordDecl)
DEFAULT_DISPATCH(EnumDecl)
- DEFAULT_DISPATCH(ObjcInterfaceDecl)
- DEFAULT_DISPATCH(ObjcClassDecl)
- DEFAULT_DISPATCH(ObjcMethodDecl)
- DEFAULT_DISPATCH(ObjcProtocolDecl)
- DEFAULT_DISPATCH(ObjcCategoryDecl)
+ DEFAULT_DISPATCH(ObjCInterfaceDecl)
+ DEFAULT_DISPATCH(ObjCClassDecl)
+ DEFAULT_DISPATCH(ObjCMethodDecl)
+ DEFAULT_DISPATCH(ObjCProtocolDecl)
+ DEFAULT_DISPATCH(ObjCCategoryDecl)
};
} // end namespace clang
Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Mon Jan 7 13:49:32 2008
@@ -21,7 +21,7 @@
namespace clang {
// Semantic.
class DeclSpec;
- class ObjcDeclSpec;
+ class ObjCDeclSpec;
class Declarator;
class AttributeList;
// Parse.
@@ -131,7 +131,7 @@
return ActOnDeclarator(FnBodyScope, D, 0);
}
- virtual void ObjcActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
+ virtual void ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
return;
}
@@ -265,7 +265,7 @@
SourceLocation RParenLoc, StmtTy *Body) {
return 0;
}
- virtual StmtResult ActOnObjcForCollectionStmt(SourceLocation ForColLoc,
+ virtual StmtResult ActOnObjCForCollectionStmt(SourceLocation ForColLoc,
SourceLocation LParenLoc,
StmtTy *First, ExprTy *Second,
SourceLocation RParenLoc, StmtTy *Body) {
@@ -307,24 +307,24 @@
}
// Objective-c statements
- virtual StmtResult ActOnObjcAtCatchStmt(SourceLocation AtLoc,
+ virtual StmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
SourceLocation RParen, StmtTy *Parm,
StmtTy *Body, StmtTy *CatchList) {
return 0;
}
- virtual StmtResult ActOnObjcAtFinallyStmt(SourceLocation AtLoc,
+ virtual StmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
StmtTy *Body) {
return 0;
}
- virtual StmtResult ActOnObjcAtTryStmt(SourceLocation AtLoc,
+ virtual StmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
StmtTy *Try,
StmtTy *Catch, StmtTy *Finally) {
return 0;
}
- virtual StmtResult ActOnObjcAtThrowStmt(SourceLocation AtLoc,
+ virtual StmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
StmtTy *Throw) {
return 0;
}
@@ -572,10 +572,10 @@
SourceLocation EndLoc, // location of the ; or {.
tok::TokenKind MethodType, // tok::minus for instance, tok::plus for class.
DeclTy *ClassDecl, // class this methods belongs to.
- ObjcDeclSpec &ReturnQT, // for return type's in inout etc.
+ ObjCDeclSpec &ReturnQT, // for return type's in inout etc.
TypeTy *ReturnType, // the method return type.
Selector Sel, // a unique name for the method.
- ObjcDeclSpec *ArgQT, // for arguments' in inout etc.
+ ObjCDeclSpec *ArgQT, // for arguments' in inout etc.
TypeTy **ArgTypes, // non-zero when Sel.getNumArgs() > 0
IdentifierInfo **ArgNames, // non-zero when Sel.getNumArgs() > 0
AttributeList *AttrList, // optional
@@ -597,9 +597,9 @@
unsigned pNum = 0) {
return;
}
- // ActOnAddObjcProperties - called to build one property AST
- virtual DeclTy *ActOnAddObjcProperties (SourceLocation AtLoc,
- DeclTy **allProperties, unsigned NumProperties, ObjcDeclSpec &DS) {
+ // ActOnAddObjCProperties - called to build one property AST
+ virtual DeclTy *ActOnAddObjCProperties (SourceLocation AtLoc,
+ DeclTy **allProperties, unsigned NumProperties, ObjCDeclSpec &DS) {
return 0;
}
Modified: cfe/trunk/include/clang/Parse/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/DeclSpec.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Parse/DeclSpec.h Mon Jan 7 13:49:32 2008
@@ -280,12 +280,12 @@
}
};
-/// ObjcDeclSpec - This class captures information about
+/// ObjCDeclSpec - This class captures information about
/// "declaration specifiers" specific to objective-c
-class ObjcDeclSpec {
+class ObjCDeclSpec {
public:
- /// ObjcDeclQualifier - Qualifier used on types in method declarations
- enum ObjcDeclQualifier {
+ /// ObjCDeclQualifier - Qualifier used on types in method declarations
+ enum ObjCDeclQualifier {
DQ_None = 0x0,
DQ_In = 0x1,
DQ_Inout = 0x2,
@@ -296,7 +296,7 @@
};
/// PropertyAttributeKind - list of property attributes.
- enum ObjcPropertyAttributeKind { DQ_PR_noattr = 0x0,
+ enum ObjCPropertyAttributeKind { DQ_PR_noattr = 0x0,
DQ_PR_readonly = 0x01,
DQ_PR_getter = 0x02,
DQ_PR_assign = 0x04,
@@ -308,17 +308,17 @@
};
- ObjcDeclSpec() : objcDeclQualifier(DQ_None), PropertyAttributes(DQ_PR_noattr)
+ ObjCDeclSpec() : objcDeclQualifier(DQ_None), PropertyAttributes(DQ_PR_noattr)
{}
- ObjcDeclQualifier getObjcDeclQualifier() const { return objcDeclQualifier; }
- void setObjcDeclQualifier(ObjcDeclQualifier DQVal)
- { objcDeclQualifier = (ObjcDeclQualifier) (objcDeclQualifier | DQVal); }
+ ObjCDeclQualifier getObjCDeclQualifier() const { return objcDeclQualifier; }
+ void setObjCDeclQualifier(ObjCDeclQualifier DQVal)
+ { objcDeclQualifier = (ObjCDeclQualifier) (objcDeclQualifier | DQVal); }
- const ObjcPropertyAttributeKind getPropertyAttributes() const
+ const ObjCPropertyAttributeKind getPropertyAttributes() const
{ return PropertyAttributes; }
- void setPropertyAttributes(ObjcPropertyAttributeKind PRVal) {
+ void setPropertyAttributes(ObjCPropertyAttributeKind PRVal) {
PropertyAttributes =
- (ObjcPropertyAttributeKind) (PropertyAttributes | PRVal);
+ (ObjCPropertyAttributeKind) (PropertyAttributes | PRVal);
}
const IdentifierInfo *getGetterName() const { return GetterName; }
@@ -332,9 +332,9 @@
// FIXME: These two are unrelated and mutially exclusive. So perhaps
// we can put them in a union to reflect their mutual exclusiveness
// (space saving is negligible).
- ObjcDeclQualifier objcDeclQualifier : 6;
+ ObjCDeclQualifier objcDeclQualifier : 6;
- ObjcPropertyAttributeKind PropertyAttributes : 8;
+ ObjCPropertyAttributeKind PropertyAttributes : 8;
IdentifierInfo *GetterName; // getter name of NULL if no getter
IdentifierInfo *SetterName; // setter name of NULL if no setter
};
Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=45715&r1=45714&r2=45715&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Mon Jan 7 13:49:32 2008
@@ -19,7 +19,7 @@
namespace clang {
class DeclSpec;
- class ObjcDeclSpec;
+ class ObjCDeclSpec;
class Declarator;
class AttributeList;
class Scope;
@@ -270,7 +270,7 @@
tok::ObjCKeywordKind contextKey);
DeclTy *ParseObjCAtProtocolDeclaration(SourceLocation atLoc);
- DeclTy *ObjcImpDecl;
+ DeclTy *ObjCImpDecl;
DeclTy *ParseObjCAtImplementationDeclaration(SourceLocation atLoc);
DeclTy *ParseObjCAtEndDeclaration(SourceLocation atLoc);
@@ -284,26 +284,26 @@
objc_in=0, objc_out, objc_inout, objc_oneway, objc_bycopy, objc_byref,
objc_NumQuals
};
- IdentifierInfo *ObjcTypeQuals[objc_NumQuals];
+ IdentifierInfo *ObjCTypeQuals[objc_NumQuals];
// Definitions for ObjC2's @property attributes.
enum ObjCPropertyAttr {
objc_readonly=0, objc_getter, objc_setter, objc_assign,
objc_readwrite, objc_retain, objc_copy, objc_nonatomic, objc_NumAttrs
};
- IdentifierInfo *ObjcPropertyAttrs[objc_NumAttrs];
+ IdentifierInfo *ObjCPropertyAttrs[objc_NumAttrs];
bool isObjCPropertyAttribute();
IdentifierInfo *ObjCForCollectionInKW;
bool isTokIdentifier_in() const;
- TypeTy *ParseObjCTypeName(ObjcDeclSpec &DS);
+ TypeTy *ParseObjCTypeName(ObjCDeclSpec &DS);
void ParseObjCMethodRequirement();
DeclTy *ParseObjCMethodPrototype(DeclTy *classOrCat,
tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword);
DeclTy *ParseObjCMethodDecl(SourceLocation mLoc, tok::TokenKind mType,
DeclTy *classDecl,
tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword);
- void ParseObjCPropertyAttribute(ObjcDeclSpec &DS);
+ void ParseObjCPropertyAttribute(ObjCDeclSpec &DS);
DeclTy *ParseObjCPropertyDecl(DeclTy *interfaceDecl, SourceLocation AtLoc);
DeclTy *ParseObjCMethodDefinition();
@@ -407,7 +407,7 @@
void ParseDeclarationSpecifiers(DeclSpec &DS);
void ParseSpecifierQualifierList(DeclSpec &DS);
- void ParseObjcTypeQualifierList(ObjcDeclSpec &DS);
+ void ParseObjCTypeQualifierList(ObjCDeclSpec &DS);
bool ParseTag(DeclTy *&Decl, unsigned TagType, SourceLocation StartLoc);
void ParseEnumSpecifier(DeclSpec &DS);
More information about the cfe-commits
mailing list