aboutsummaryrefslogtreecommitdiff
path: root/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2007-09-18 20:26:58 +0000
committerFariborz Jahanian <fjahanian@apple.com>2007-09-18 20:26:58 +0000
commitfd225cc227143553898f2d3902242d25db9a4902 (patch)
treee012e139c6f745a8cda686eee6bca618d03478e4 /Parse/ParseObjc.cpp
parent8e2806573e74465c887a23b1bb4a05769a59b564 (diff)
Patch for object creation and handling of category declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Parse/ParseObjc.cpp')
-rw-r--r--Parse/ParseObjc.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index dd9ab2e152..224b826374 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -130,6 +130,7 @@ Parser::DeclTy *Parser::ParseObjCAtInterfaceDeclaration(
SourceLocation lparenLoc = ConsumeParen();
SourceLocation categoryLoc, rparenLoc;
IdentifierInfo *categoryId = 0;
+ llvm::SmallVector<IdentifierInfo *, 8> ProtocolRefs;
// For ObjC2, the category name is optional (not an error).
if (Tok.getKind() == tok::identifier) {
@@ -147,14 +148,19 @@ Parser::DeclTy *Parser::ParseObjCAtInterfaceDeclaration(
rparenLoc = ConsumeParen();
// Next, we need to check for any protocol references.
if (Tok.getKind() == tok::less) {
- llvm::SmallVector<IdentifierInfo *, 8> ProtocolRefs;
if (ParseObjCProtocolReferences(ProtocolRefs))
return 0;
}
if (attrList) // categories don't support attributes.
Diag(Tok, diag::err_objc_no_attributes_on_category);
- ParseObjCInterfaceDeclList(0, tok::objc_not_keyword/*FIXME*/);
+ DeclTy *CategoryType = Actions.ObjcStartCatInterface(atLoc,
+ nameId, nameLoc,
+ categoryId, categoryLoc,
+ &ProtocolRefs[0],
+ ProtocolRefs.size());
+
+ ParseObjCInterfaceDeclList(CategoryType, tok::objc_not_keyword);
// The @ sign was already consumed by ParseObjCInterfaceDeclList().
if (Tok.isObjCAtKeyword(tok::objc_end)) {