From f41cf7f10f76704b7037de9a8a7adcc114db1c46 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 10 Dec 2013 19:43:48 +0000 Subject: Rename attribute 'objc_suppress_protocol_methods' to 'objc_protocol_requires_explicit_implementation'. That's a mouthful, and not necessarily the final name. This also reflects a semantic change where this attribute is now on the protocol itself instead of a class. This attribute will require that a protocol, when adopted by a class, is explicitly implemented by the class itself (instead of walking the super class chain). Note that this attribute is not "done". This should be considered a WIP. llvm-svn: 196955 --- clang/lib/AST/DeclObjC.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'clang/lib/AST/DeclObjC.cpp') diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index fb4b9dbd1f4..3db1acf0039 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -256,18 +256,6 @@ ObjCContainerDecl::FindPropertyDeclaration(IdentifierInfo *PropertyId) const { void ObjCInterfaceDecl::anchor() { } -bool ObjCInterfaceDecl::shouldSuppressProtocol(const ObjCProtocolDecl *P) const{ - if (!hasAttrs()) - return false; - const IdentifierInfo *PI = P->getIdentifier(); - for (specific_attr_iterator - I = specific_attr_begin(), - E = specific_attr_end(); I != E; ++I) - if ((*I)->getProtocol() == PI) - return true; - return false; -} - /// FindPropertyVisibleInPrimaryClass - Finds declaration of the property /// with name 'PropertyId' in the primary class; including those in protocols /// (direct or indirect) used by the primary class. @@ -555,8 +543,7 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup, bool followSuper, - const ObjCCategoryDecl *C, - const ObjCProtocolDecl *P) const + const ObjCCategoryDecl *C) const { // FIXME: Should make sure no callers ever do this. if (!hasDefinition()) @@ -569,12 +556,6 @@ ObjCMethodDecl *ObjCInterfaceDecl::lookupMethod(Selector Sel, LoadExternalDefinition(); while (ClassDecl) { - // If we are looking for a method that is part of protocol conformance, - // check if the superclass has been marked to suppress conformance - // of that protocol. - if (P && ClassDecl->shouldSuppressProtocol(P)) - return 0; - if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance))) return MethodDecl; -- cgit v1.2.3