diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-22 21:44:58 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-22 21:44:58 +0000 |
commit | b66de9f37b6f2954cf963719e02392bd59cca945 (patch) | |
tree | b49e9ec34767b33c54b025b21f170158bf17c753 /clang/lib/Parse/ParseObjc.cpp | |
parent | fd5148b45dc256cf61fc6b6d9f64757a029ceb69 (diff) | |
download | bcm5719-llvm-b66de9f37b6f2954cf963719e02392bd59cca945.tar.gz bcm5719-llvm-b66de9f37b6f2954cf963719e02392bd59cca945.zip |
objc refactoring - minor clean up.
llvm-svn: 138276
Diffstat (limited to 'clang/lib/Parse/ParseObjc.cpp')
-rw-r--r-- | clang/lib/Parse/ParseObjc.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 7512bbc5ff3..684d8edf891 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -199,9 +199,7 @@ Decl *Parser::ParseObjCAtInterfaceDeclaration(SourceLocation atLoc, if (Tok.is(tok::l_brace)) ParseObjCClassInstanceVariables(CategoryType, tok::objc_private, atLoc); - Actions.ActOnObjCContainerStartDefinition(CategoryType); - ParseObjCInterfaceDeclList(tok::objc_not_keyword); - Actions.ActOnObjCContainerFinishDefinition(CategoryType); + ParseObjCInterfaceDeclList(tok::objc_not_keyword, CategoryType); return CategoryType; } // Parse a class interface. @@ -243,9 +241,7 @@ Decl *Parser::ParseObjCAtInterfaceDeclaration(SourceLocation atLoc, if (Tok.is(tok::l_brace)) ParseObjCClassInstanceVariables(ClsType, tok::objc_protected, atLoc); - Actions.ActOnObjCContainerStartDefinition(ClsType); - ParseObjCInterfaceDeclList(tok::objc_interface); - Actions.ActOnObjCContainerFinishDefinition(ClsType); + ParseObjCInterfaceDeclList(tok::objc_interface, ClsType); return ClsType; } @@ -317,14 +313,16 @@ struct Parser::ObjCPropertyCallback : FieldCallback { /// @required /// @optional /// -void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey) { +void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey, + Decl *CDecl) { SmallVector<Decl *, 32> allMethods; SmallVector<Decl *, 16> allProperties; SmallVector<DeclGroupPtrTy, 8> allTUVariables; tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword; SourceRange AtEnd; - + Actions.ActOnObjCContainerStartDefinition(CDecl); + while (1) { // If this is a method prototype, parse it. if (Tok.is(tok::minus) || Tok.is(tok::plus)) { @@ -461,6 +459,7 @@ void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey) { allMethods.data(), allMethods.size(), allProperties.data(), allProperties.size(), allTUVariables.data(), allTUVariables.size()); + Actions.ActOnObjCContainerFinishDefinition(CDecl); } /// Parse property attribute declarations. @@ -1292,10 +1291,7 @@ Decl *Parser::ParseObjCAtProtocolDeclaration(SourceLocation AtLoc, ProtocolLocs.data(), EndProtoLoc, attrs.getList()); - - Actions.ActOnObjCContainerStartDefinition(ProtoType); - ParseObjCInterfaceDeclList(tok::objc_protocol); - Actions.ActOnObjCContainerFinishDefinition(ProtoType); + ParseObjCInterfaceDeclList(tok::objc_protocol, ProtoType); return ProtoType; } |