diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-26 04:07:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-26 04:07:02 +0000 |
commit | 6bd6d0b9d8944c5e192097bef24f2becb83af172 (patch) | |
tree | 0030f21c52bca4980db2b0f478c5ab219a472529 /lib/Parse/ParseObjc.cpp | |
parent | e13b9595dc1e2f4288bec34f3412359f648e84a5 (diff) |
refactor protocol resolution out of ActOnStartCategoryInterface
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 1bfc2a949b..cabb5bf69a 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -131,7 +131,6 @@ Parser::DeclTy *Parser::ParseObjCAtInterfaceDeclaration( SourceLocation lparenLoc = ConsumeParen(); SourceLocation categoryLoc, rparenLoc; IdentifierInfo *categoryId = 0; - llvm::SmallVector<IdentifierLocPair, 8> ProtocolRefs; // For ObjC2, the category name is optional (not an error). if (Tok.is(tok::identifier)) { @@ -147,19 +146,21 @@ Parser::DeclTy *Parser::ParseObjCAtInterfaceDeclaration( return 0; } rparenLoc = ConsumeParen(); - SourceLocation endProtoLoc; + // Next, we need to check for any protocol references. - if (Tok.is(tok::less)) { - if (ParseObjCProtocolReferences(ProtocolRefs, endProtoLoc)) - return 0; - } + SourceLocation EndProtoLoc; + llvm::SmallVector<DeclTy *, 8> ProtocolRefs; + if (Tok.is(tok::less) && + ParseObjCProtocolReferences(ProtocolRefs, true, EndProtoLoc)) + return 0; + if (attrList) // categories don't support attributes. Diag(Tok, diag::err_objc_no_attributes_on_category); DeclTy *CategoryType = Actions.ActOnStartCategoryInterface(atLoc, nameId, nameLoc, categoryId, categoryLoc, &ProtocolRefs[0], ProtocolRefs.size(), - endProtoLoc); + EndProtoLoc); ParseObjCInterfaceDeclList(CategoryType, tok::objc_not_keyword); |