[cfe-commits] r138276 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/ParseObjc.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Aug 22 14:44:58 PDT 2011


Author: fjahanian
Date: Mon Aug 22 16:44:58 2011
New Revision: 138276

URL: http://llvm.org/viewvc/llvm-project?rev=138276&view=rev
Log:
objc refactoring - minor clean up.

Modified:
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/lib/Parse/ParseObjc.cpp

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=138276&r1=138275&r2=138276&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Mon Aug 22 16:44:58 2011
@@ -1073,7 +1073,8 @@
                                    SourceLocation &LAngleLoc,
                                    SourceLocation &EndProtoLoc);
   bool ParseObjCProtocolQualifiers(DeclSpec &DS);
-  void ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey);
+  void ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey,
+                                  Decl *CDecl);
   Decl *ParseObjCAtProtocolDeclaration(SourceLocation atLoc,
                                        ParsedAttributes &prefixAttrs);
 

Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=138276&r1=138275&r2=138276&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Mon Aug 22 16:44:58 2011
@@ -199,9 +199,7 @@
     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 @@
   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 @@
 ///     @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 @@
                      allMethods.data(), allMethods.size(),
                      allProperties.data(), allProperties.size(),
                      allTUVariables.data(), allTUVariables.size());
+  Actions.ActOnObjCContainerFinishDefinition(CDecl);
 }
 
 ///   Parse property attribute declarations.
@@ -1292,10 +1291,7 @@
                                         ProtocolLocs.data(),
                                         EndProtoLoc, attrs.getList());
 
-
-  Actions.ActOnObjCContainerStartDefinition(ProtoType);
-  ParseObjCInterfaceDeclList(tok::objc_protocol);
-  Actions.ActOnObjCContainerFinishDefinition(ProtoType);
+  ParseObjCInterfaceDeclList(tok::objc_protocol, ProtoType);
   return ProtoType;
 }
 





More information about the cfe-commits mailing list