diff options
-rw-r--r-- | include/clang/AST/ASTContext.h | 5 | ||||
-rw-r--r-- | include/clang/AST/Type.h | 6 | ||||
-rw-r--r-- | lib/AST/ASTContext.cpp | 25 | ||||
-rw-r--r-- | lib/AST/ExprConstant.cpp | 3 | ||||
-rw-r--r-- | lib/AST/Type.cpp | 27 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 1 | ||||
-rw-r--r-- | lib/Sema/SemaType.cpp | 4 | ||||
-rw-r--r-- | test/SemaObjC/protocol-archane.m | 5 | ||||
-rw-r--r-- | test/SemaObjC/protocol-atttribute-1.m | 4 |
9 files changed, 4 insertions, 76 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 0353a892e6..387120ea3d 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -73,7 +73,6 @@ class ASTContext { ClassTemplateSpecializationTypes; llvm::FoldingSet<ObjCQualifiedInterfaceType> ObjCQualifiedInterfaceTypes; llvm::FoldingSet<ObjCQualifiedIdType> ObjCQualifiedIdTypes; - llvm::FoldingSet<ObjCQualifiedClassType> ObjCQualifiedClassTypes; /// ASTRecordLayouts - A cache mapping from RecordDecls to ASTRecordLayouts. /// This is lazily created. This is intentionally not serialized. llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*> ASTRecordLayouts; @@ -292,10 +291,6 @@ public: QualType getObjCQualifiedIdType(ObjCProtocolDecl **ProtocolList, unsigned NumProtocols); - /// getObjCQualifiedClassType - Return an ObjCQualifiedClassType for a - /// given 'Class' and conforming protocol list. - QualType getObjCQualifiedClassType(ObjCProtocolDecl **ProtocolList, - unsigned NumProtocols); /// getTypeOfType - GCC extension. QualType getTypeOfExpr(Expr *e); diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index cb34c77f1a..8b7b09c91f 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -69,7 +69,6 @@ namespace clang { class BuiltinType; class ObjCInterfaceType; class ObjCQualifiedIdType; - class ObjCQualifiedClassType; class ObjCQualifiedInterfaceType; class StmtIteratorBase; class ClassTemplateSpecializationType; @@ -385,7 +384,6 @@ public: bool isObjCInterfaceType() const; // NSString or NSString<foo> bool isObjCQualifiedInterfaceType() const; // NSString<foo> bool isObjCQualifiedIdType() const; // id<foo> - bool isObjCQualifiedClassType() const; // Class<foo> bool isTemplateTypeParmType() const; // C++ template type parameter /// isDependentType - Whether this type is a dependent type, meaning @@ -419,7 +417,6 @@ public: const ObjCInterfaceType *getAsObjCInterfaceType() const; const ObjCQualifiedInterfaceType *getAsObjCQualifiedInterfaceType() const; const ObjCQualifiedIdType *getAsObjCQualifiedIdType() const; - const ObjCQualifiedClassType *getAsObjCQualifiedClassType() const; const TemplateTypeParmType *getAsTemplateTypeParmType() const; const ClassTemplateSpecializationType * @@ -1945,9 +1942,6 @@ inline bool Type::isObjCQualifiedInterfaceType() const { inline bool Type::isObjCQualifiedIdType() const { return isa<ObjCQualifiedIdType>(CanonicalType.getUnqualifiedType()); } -inline bool Type::isObjCQualifiedClassType() const { - return isa<ObjCQualifiedClassType>(CanonicalType.getUnqualifiedType()); -} inline bool Type::isTemplateTypeParmType() const { return isa<TemplateTypeParmType>(CanonicalType.getUnqualifiedType()); } diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 78f2a8a9ab..60d8b8be80 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1397,29 +1397,6 @@ QualType ASTContext::getObjCQualifiedIdType(ObjCProtocolDecl **Protocols, return QualType(QType, 0); } -/// getObjCQualifiedClassType - Return an ObjCQualifiedIdType for the 'Class' -/// decl and the conforming protocol list. -QualType ASTContext::getObjCQualifiedClassType(ObjCProtocolDecl **Protocols, - unsigned NumProtocols) { - // Sort the protocol list alphabetically to canonicalize it. - SortAndUniqueProtocols(Protocols, NumProtocols); - - llvm::FoldingSetNodeID ID; - ObjCQualifiedIdType::Profile(ID, Protocols, NumProtocols); - - void *InsertPos = 0; - if (ObjCQualifiedClassType *QT = - ObjCQualifiedClassTypes.FindNodeOrInsertPos(ID, InsertPos)) - return QualType(QT, 0); - - // No Match; - ObjCQualifiedClassType *QType = - new (*this,8) ObjCQualifiedClassType(Protocols, NumProtocols); - Types.push_back(QType); - ObjCQualifiedClassTypes.InsertNode(QType, InsertPos); - return QualType(QType, 0); -} - /// getTypeOfExpr - Unlike many "get<Type>" functions, we can't unique /// TypeOfExpr AST's (since expression's are never shared). For example, /// multiple declarations that refer to "typeof(x)" all contain different @@ -2422,7 +2399,7 @@ bool ASTContext::isObjCNSObjectType(QualType Ty) const { /// to struct), Interface* (pointer to ObjCInterfaceType) and id<P> (qualified /// ID type). bool ASTContext::isObjCObjectPointerType(QualType Ty) const { - if (Ty->isObjCQualifiedIdType() || Ty->isObjCQualifiedClassType()) + if (Ty->isObjCQualifiedIdType()) return true; // Blocks are objects. diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index d868cba9eb..bfba5984b0 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -285,8 +285,7 @@ public: static bool HasPointerEvalType(const Expr* E) { return E->getType()->isPointerType() || E->getType()->isBlockPointerType() - || E->getType()->isObjCQualifiedIdType() - || E->getType()->isObjCQualifiedClassType(); + || E->getType()->isObjCQualifiedIdType(); } static bool EvaluatePointer(const Expr* E, APValue& Result, EvalInfo &Info) { diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 065b626930..7b07b9cbe4 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -870,17 +870,6 @@ void ObjCQualifiedIdType::Profile(llvm::FoldingSetNodeID &ID) { Profile(ID, &Protocols[0], getNumProtocols()); } -void ObjCQualifiedClassType::Profile(llvm::FoldingSetNodeID &ID, - ObjCProtocolDecl **protocols, - unsigned NumProtocols) { - for (unsigned i = 0; i != NumProtocols; i++) - ID.AddPointer(protocols[i]); -} - -void ObjCQualifiedClassType::Profile(llvm::FoldingSetNodeID &ID) { - Profile(ID, &Protocols[0], getNumProtocols()); -} - /// LookThroughTypedefs - Return the ultimate type this typedef corresponds to /// potentially looking through *all* consequtive typedefs. This returns the /// sum of the type qualifiers, so if you have: @@ -1357,22 +1346,6 @@ void ObjCQualifiedIdType::getAsStringInternal(std::string &InnerString) const { InnerString = ObjCQIString + InnerString; } -void ObjCQualifiedClassType::getAsStringInternal(std::string &InnerString) const -{ - if (!InnerString.empty()) // Prefix the basic type, e.g. 'typedefname X'. - InnerString = ' ' + InnerString; - std::string ObjCQIString = "Class"; - ObjCQIString += '<'; - int num = getNumProtocols(); - for (int i = 0; i < num; i++) { - ObjCQIString += getProtocols(i)->getNameAsString(); - if (i < num-1) - ObjCQIString += ','; - } - ObjCQIString += '>'; - InnerString = ObjCQIString + InnerString; -} - void TagType::getAsStringInternal(std::string &InnerString) const { if (!InnerString.empty()) // Prefix the basic type, e.g. 'typedefname X'. InnerString = ' ' + InnerString; diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index b17f7bc1ca..aef66619f6 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -2736,7 +2736,6 @@ Sema::CheckSingleAssignmentConstraints(QualType lhsType, Expr *&rExpr) { // a null pointer constant. if ((lhsType->isPointerType() || lhsType->isObjCQualifiedIdType() || - lhsType->isObjCQualifiedClassType() || lhsType->isBlockPointerType()) && rExpr->isNullPointerConstant(Context)) { ImpCastExprToType(rExpr, lhsType); diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 697524133c..acdeec6ba9 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -151,10 +151,6 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS) { // id<protocol-list> Result = Context.getObjCQualifiedIdType((ObjCProtocolDecl**)PQ, DS.getNumProtocolQualifiers()); - else if (Result == Context.getObjCClassType()) - // Support the following GCC extension: Class<protocol-list> - Result = Context.getObjCQualifiedClassType((ObjCProtocolDecl**)PQ, - DS.getNumProtocolQualifiers()); else Diag(DS.getSourceRange().getBegin(), diag::warn_ignoring_objc_qualifiers) << DS.getSourceRange(); diff --git a/test/SemaObjC/protocol-archane.m b/test/SemaObjC/protocol-archane.m index ff08a176bf..2cba1fad05 100644 --- a/test/SemaObjC/protocol-archane.m +++ b/test/SemaObjC/protocol-archane.m @@ -27,8 +27,3 @@ typedef int NotAnObjCObjectType; // GCC doesn't diagnose this. NotAnObjCObjectType <SomeProtocol> *obj; // expected-warning {{ignoring protocol qualifiers on non-ObjC type}} - -// GCC extension (sigh). Found while researching rdar://6497631 -typedef struct objc_class *Class; - -Class <SomeProtocol> UnfortunateGCCExtension; diff --git a/test/SemaObjC/protocol-atttribute-1.m b/test/SemaObjC/protocol-atttribute-1.m index 21912dafae..1d3aec64c4 100644 --- a/test/SemaObjC/protocol-atttribute-1.m +++ b/test/SemaObjC/protocol-atttribute-1.m @@ -3,7 +3,7 @@ __attribute ((unavailable)) @protocol FwProto; // expected-note{{marked unavailable}} -Class <FwProto> cFw = 0; // expected-warning {{'FwProto' is unavailable}} +Class <FwProto> cFw = 0; // expected-warning {{'FwProto' is unavailable}} expected-warning{{ignoring protocol qualifiers on non-ObjC type}} __attribute ((deprecated)) @protocol MyProto1 @@ -31,7 +31,7 @@ __attribute ((deprecated)) @protocol MyProto1 -Class <MyProto1> clsP1 = 0; // expected-warning {{'MyProto1' is deprecated}} +Class <MyProto1> clsP1 = 0; // expected-warning {{'MyProto1' is deprecated}} expected-warning{{ignoring protocol qualifiers on non-ObjC type}} @protocol FwProto @end // expected-note{{marked unavailable}} |