diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-03-23 11:44:25 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-03-23 11:44:25 +0000 |
commit | f9371395300cc20d7a302e647de9ecda4bdf6b7e (patch) | |
tree | a8f235be334048dbc062b2f2ce654c19c8f06e99 /clang/lib/Parse/ParseObjc.cpp | |
parent | a8fbef44fe2347942e2eb76e5b9144d74b5bdc7e (diff) | |
download | bcm5719-llvm-f9371395300cc20d7a302e647de9ecda4bdf6b7e.tar.gz bcm5719-llvm-f9371395300cc20d7a302e647de9ecda4bdf6b7e.zip |
Support attributes for Objective-C categories
rdar://31095315
Differential Revision: https://reviews.llvm.org/D31179
llvm-svn: 298589
Diffstat (limited to 'clang/lib/Parse/ParseObjc.cpp')
-rw-r--r-- | clang/lib/Parse/ParseObjc.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 9f6f91c9fcc..47674738d17 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -278,11 +278,6 @@ Decl *Parser::ParseObjCAtInterfaceDeclaration(SourceLocation AtLoc, T.consumeClose(); if (T.getCloseLocation().isInvalid()) return nullptr; - - if (!attrs.empty()) { // categories don't support attributes. - Diag(nameLoc, diag::err_objc_no_attributes_on_category); - attrs.clear(); - } // Next, we need to check for any protocol references. assert(LAngleLoc.isInvalid() && "Cannot have already parsed protocols"); @@ -294,16 +289,11 @@ Decl *Parser::ParseObjCAtInterfaceDeclaration(SourceLocation AtLoc, /*consumeLastToken=*/true)) return nullptr; - Decl *CategoryType = - Actions.ActOnStartCategoryInterface(AtLoc, - nameId, nameLoc, - typeParameterList, - categoryId, categoryLoc, - ProtocolRefs.data(), - ProtocolRefs.size(), - ProtocolLocs.data(), - EndProtoLoc); - + Decl *CategoryType = Actions.ActOnStartCategoryInterface( + AtLoc, nameId, nameLoc, typeParameterList, categoryId, categoryLoc, + ProtocolRefs.data(), ProtocolRefs.size(), ProtocolLocs.data(), + EndProtoLoc, attrs.getList()); + if (Tok.is(tok::l_brace)) ParseObjCClassInstanceVariables(CategoryType, tok::objc_private, AtLoc); |