diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-05-04 17:04:30 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-05-04 17:04:30 +0000 |
commit | 1c6a3cc88177c67498fccdf14cfdf09959214e41 (patch) | |
tree | 63083f37732575f3474b4183f0318b573d8b16a4 /lib/Sema | |
parent | c6e2ab0dd61e53fa7889a4f97d74d53f4b1af278 (diff) |
Remove support for ObjCMethodDecl attributes that appear between the
return type and the selector. This is inconsistent with C functions
(where such attributes would be placed on the return type, not the the
FunctionDecl), and is inconsistent with what people are use to seeing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/Sema.h | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 34 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 4 |
3 files changed, 0 insertions, 42 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 1c652114e3..3ca00ca143 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -1098,9 +1098,6 @@ public: // Decl attributes - this routine is the top level dispatcher. void ProcessDeclAttributes(Decl *D, const Declarator &PD); void ProcessDeclAttributeList(Decl *D, const AttributeList *AttrList); - - void ProcessObjCMethDeclReturnAttributeList(ObjCMethodDecl *D, - const AttributeList *AttrList); void WarnUndefinedMethod(SourceLocation ImpLoc, ObjCMethodDecl *method, bool &IncompleteImpl); @@ -2227,7 +2224,6 @@ public: // from the Sel.getNumArgs(). ObjCArgInfo *ArgInfo, llvm::SmallVectorImpl<Declarator> &Cdecls, - AttributeList *ReturnAttrList, AttributeList *AttrList, tok::ObjCKeywordKind MethodImplKind, bool isVariadic = false); diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 1e3a7e58bb..68d682ddab 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -1719,37 +1719,3 @@ void Sema::ProcessDeclAttributes(Decl *D, const Declarator &PD) { if (const AttributeList *Attrs = PD.getAttributes()) ProcessDeclAttributeList(D, Attrs); } - - -/// ProcessObjCMethDeclReturnAttribute - Apply the specific attribute to the -/// specified ObjCMethodDecl. This is a separate codepath because it -/// corresponds to attributes applied essentially to the return type of -/// an Objective-C method declaration (as opposed to attributes that hang off -/// the end of the method declaration). -static void ProcessObjCMethDeclReturnAttribute(Decl *D, - const AttributeList &Attr, - Sema &S) { - switch (Attr.getKind()) { - // Checker-specific. - case AttributeList::AT_objc_ownership_returns: - HandleObjCOwnershipReturnsAttr(D, Attr, S); break; - break; - default: - S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); - break; - } -} - -/// ProcessObjCMethDeclAttributeList - Apply all the decl attributes in the -/// specified attribute list to the specified ObjCMethodDecl. This is -/// a separate codepath because it corresponds to attributes applied -/// essentiallyto the return type of an Objective-C method declaration -/// (as opposed to attributes that hang off the end of the method declaration). -void Sema::ProcessObjCMethDeclReturnAttributeList(ObjCMethodDecl *D, - const AttributeList *AttrList) -{ - while (AttrList) { - ProcessObjCMethDeclReturnAttribute(D, *AttrList, *this); - AttrList = AttrList->getNext(); - } -} diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 80b30bdb74..0e655a493d 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1557,7 +1557,6 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration( // from the Sel.getNumArgs(). ObjCArgInfo *ArgInfo, llvm::SmallVectorImpl<Declarator> &Cdecls, - AttributeList *ReturnAttrList, AttributeList *AttrList, tok::ObjCKeywordKind MethodDeclKind, bool isVariadic) { Decl *ClassDecl = classDecl.getAs<Decl>(); @@ -1640,9 +1639,6 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration( if (AttrList) ProcessDeclAttributeList(ObjCMethod, AttrList); - if (ReturnAttrList) - ProcessObjCMethDeclReturnAttributeList(ObjCMethod, ReturnAttrList); - // 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 |