summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseObjc.cpp13
-rw-r--r--clang/lib/Sema/Sema.h4
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp34
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp4
4 files changed, 3 insertions, 52 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp
index 2e0df826bb2..6c42f429ccd 100644
--- a/clang/lib/Parse/ParseObjc.cpp
+++ b/clang/lib/Parse/ParseObjc.cpp
@@ -677,12 +677,6 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc,
if (Tok.is(tok::l_paren))
ReturnType = ParseObjCTypeName(DSRet);
- // Parse attributes that can appear before the selector.
- AttributeList *ReturnAttrs = 0;
-
- if (getLang().ObjC2 && Tok.is(tok::kw___attribute))
- ReturnAttrs = ParseAttributes();
-
SourceLocation selLoc;
IdentifierInfo *SelIdent = ParseObjCSelectorPiece(selLoc);
@@ -705,8 +699,8 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc,
Selector Sel = PP.getSelectorTable().getNullarySelector(SelIdent);
return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
mType, IDecl, DSRet, ReturnType, Sel,
- 0, CargNames, ReturnAttrs,
- MethodAttrs, MethodImplKind);
+ 0, CargNames, MethodAttrs,
+ MethodImplKind);
}
llvm::SmallVector<IdentifierInfo *, 12> KeyIdents;
@@ -779,8 +773,7 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc,
&KeyIdents[0]);
return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
mType, IDecl, DSRet, ReturnType, Sel,
- &ArgInfos[0], CargNames, ReturnAttrs,
- MethodAttrs,
+ &ArgInfos[0], CargNames, MethodAttrs,
MethodImplKind, isVariadic);
}
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 1c652114e36..3ca00ca1433 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/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/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 1e3a7e58bb1..68d682ddab8 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 80b30bdb74c..0e655a493da 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud