diff options
| author | Ted Kremenek <kremenek@apple.com> | 2013-11-21 07:57:53 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2013-11-21 07:57:53 +0000 |
| commit | a14c3119acc4f0c70cb91a847d55175e7be0f1a7 (patch) | |
| tree | adf7088936a4bf90e3b53446b1e39c938d1a3423 /clang/lib/Sema | |
| parent | fbc1adbaa75ae4f065461ccab279a43c46c94bf2 (diff) | |
| download | bcm5719-llvm-a14c3119acc4f0c70cb91a847d55175e7be0f1a7.tar.gz bcm5719-llvm-a14c3119acc4f0c70cb91a847d55175e7be0f1a7.zip | |
Revert "Add new attribute 'objc_suppress_protocol' to suppress protocol conformance for a class."
After implementing this patch, a few concerns about the language
feature itself emerged in my head that I had previously not considered.
I want to resolve those design concerns first before having
a half-designed language feature in the tree.
llvm-svn: 195328
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 29 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 13 |
2 files changed, 5 insertions, 37 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 0c025b78497..38bffa2f99e 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -2134,30 +2134,6 @@ static void handleObjCRootClassAttr(Sema &S, Decl *D, Attr.getAttributeSpellingListIndex())); } -static void handleObjCSuppresProtocolAttr(Sema &S, Decl *D, - const AttributeList &Attr) { - if (!isa<ObjCInterfaceDecl>(D)) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_decl_type) - << Attr.getName() << ExpectedObjectiveCInterface; - return; - } - - IdentifierLoc *Parm = NULL; - if (Attr.getNumArgs() == 1) { - Parm = Attr.isArgIdent(0) ? Attr.getArgAsIdent(0) : 0; - } - - if (!Parm) { - S.Diag(D->getLocStart(), diag::err_objc_attr_not_id) << Attr.getName() << 1; - return; - } - - D->addAttr(::new (S.Context) - ObjCSuppressProtocolAttr(Attr.getRange(), S.Context, Parm->Ident, - Attr.getAttributeSpellingListIndex())); -} - - static void handleObjCRequiresPropertyDefsAttr(Sema &S, Decl *D, const AttributeList &Attr) { if (!isa<ObjCInterfaceDecl>(D)) { @@ -4714,10 +4690,7 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_ObjCRootClass: handleObjCRootClassAttr(S, D, Attr); break; - case AttributeList::AT_ObjCSuppressProtocol: - handleObjCSuppresProtocolAttr(S, D, Attr); - break; - case AttributeList::AT_ObjCRequiresPropertyDefs: + case AttributeList::AT_ObjCRequiresPropertyDefs: handleObjCRequiresPropertyDefsAttr (S, D, Attr); break; case AttributeList::AT_Unused: handleUnusedAttr (S, D, Attr); break; diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 2a781b5bd7d..f44fb325114 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -1664,8 +1664,7 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, if (method->getImplementationControl() != ObjCMethodDecl::Optional && !method->isPropertyAccessor() && !InsMap.count(method->getSelector()) && - (!Super || !Super->lookupInstanceMethod(method->getSelector(), - false, PDecl))) { + (!Super || !Super->lookupInstanceMethod(method->getSelector()))) { // If a method is not implemented in the category implementation but // has been declared in its primary class, superclass, // or in one of their protocols, no need to issue the warning. @@ -1677,8 +1676,7 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, // uses the protocol. if (ObjCMethodDecl *MethodInClass = IDecl->lookupInstanceMethod(method->getSelector(), - true /*shallowCategoryLookup*/, - PDecl)) + true /*shallowCategoryLookup*/)) if (C || MethodInClass->isPropertyAccessor()) continue; unsigned DIAG = diag::warn_unimplemented_protocol_method; @@ -1697,13 +1695,10 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, ObjCMethodDecl *method = *I; if (method->getImplementationControl() != ObjCMethodDecl::Optional && !ClsMap.count(method->getSelector()) && - (!Super || !Super->lookupClassMethod(method->getSelector(), - /* shallowCategoryLookup */ false, - PDecl))) { + (!Super || !Super->lookupClassMethod(method->getSelector()))) { // See above comment for instance method lookups. if (C && IDecl->lookupClassMethod(method->getSelector(), - true /*shallowCategoryLookup*/, - PDecl)) + true /*shallowCategoryLookup*/)) continue; unsigned DIAG = diag::warn_unimplemented_protocol_method; if (Diags.getDiagnosticLevel(DIAG, ImpLoc) != |

