aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-04-30 18:41:06 +0000
committerTed Kremenek <kremenek@apple.com>2009-04-30 18:41:06 +0000
commitb27d1174673d457e2ee7906c14a92bba35242cea (patch)
tree60e246bcf0349c919f6ceb7f90bc9527e0f350fa /lib/Sema/SemaDeclObjC.cpp
parent77755a57c9e85418626ac64c0d38975d5fa9aded (diff)
Hook up Sema support for attributes on Objective-C method declarations that
appear between the return type and the selector. This is a separate code path from regular attribute processing, as we only want to (a) accept only a specific set of attributes in this place and (b) want to distinguish to clients the context in which an attribute was added to an ObjCMethodDecl. Currently, the attribute 'objc_ownership_returns' is the only attribute that uses this new feature. Shortly I will add a warning for 'objc_ownership_returns' to be placed at the end of a method declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 170efec5f3..61f62cd4bf 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1509,6 +1509,7 @@ 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>();
@@ -1590,6 +1591,9 @@ 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