diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-04-30 18:41:06 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-04-30 18:41:06 +0000 |
commit | 290fbb1d42c9e50e94aecf72e40030b6b85b5786 (patch) | |
tree | c5530eac072161d89861fe46b942d62dd0efd464 /clang/lib/Sema/SemaDeclObjC.cpp | |
parent | 007cbe91c58442ca7032eb006a68560c306c1028 (diff) | |
download | bcm5719-llvm-290fbb1d42c9e50e94aecf72e40030b6b85b5786.tar.gz bcm5719-llvm-290fbb1d42c9e50e94aecf72e40030b6b85b5786.zip |
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.
llvm-svn: 70504
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 170efec5f37..61f62cd4bf7 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/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 |