[cfe-commits] r43475 - in /cfe/trunk: AST/Decl.cpp Parse/ParseDecl.cpp Parse/ParseObjc.cpp Sema/Sema.h Sema/SemaDecl.cpp clang.xcodeproj/project.pbxproj include/clang/AST/DeclObjC.h include/clang/Parse/Action.h include/clang/Parse/Parser.h

Steve Naroff snaroff at apple.com
Mon Oct 29 14:38:07 PDT 2007


Author: snaroff
Date: Mon Oct 29 16:38:07 2007
New Revision: 43475

URL: http://llvm.org/viewvc/llvm-project?rev=43475&view=rev
Log:

This commit contains lot's of small tweaks to how we pass around and store SourceLocation's for interfaces/protocols/categories/implementations.


Modified:
    cfe/trunk/AST/Decl.cpp
    cfe/trunk/Parse/ParseDecl.cpp
    cfe/trunk/Parse/ParseObjc.cpp
    cfe/trunk/Sema/Sema.h
    cfe/trunk/Sema/SemaDecl.cpp
    cfe/trunk/clang.xcodeproj/project.pbxproj
    cfe/trunk/include/clang/AST/DeclObjC.h
    cfe/trunk/include/clang/Parse/Action.h
    cfe/trunk/include/clang/Parse/Parser.h

Modified: cfe/trunk/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Decl.cpp?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/AST/Decl.cpp (original)
+++ cfe/trunk/AST/Decl.cpp Mon Oct 29 16:38:07 2007
@@ -293,13 +293,15 @@
 /// ObjcAddInstanceVariablesToClass - Inserts instance variables
 /// into ObjcInterfaceDecl's fields.
 ///
-void ObjcInterfaceDecl::ObjcAddInstanceVariablesToClass(ObjcIvarDecl **ivars,
-                                                        unsigned numIvars) {
+void ObjcInterfaceDecl::addInstanceVariablesToClass(ObjcIvarDecl **ivars,
+                                                    unsigned numIvars,
+                                                    SourceLocation RB) {
   NumIvars = numIvars;
   if (numIvars) {
     Ivars = new ObjcIvarDecl*[numIvars];
     memcpy(Ivars, ivars, numIvars*sizeof(ObjcIvarDecl*));
   }
+  RBracLoc = RB;
 }
 
 /// ObjcAddInstanceVariablesToClassImpl - Checks for correctness of Instance 
@@ -315,13 +317,14 @@
   }
 }
 
-/// addObjcMethods - Insert instance and methods declarations into
+/// addMethods - Insert instance and methods declarations into
 /// ObjcInterfaceDecl's InsMethods and ClsMethods fields.
 ///
-void ObjcInterfaceDecl::ObjcAddMethods(ObjcMethodDecl **insMethods, 
-                                       unsigned numInsMembers,
-                                       ObjcMethodDecl **clsMethods,
-                                       unsigned numClsMembers) {
+void ObjcInterfaceDecl::addMethods(ObjcMethodDecl **insMethods, 
+                                   unsigned numInsMembers,
+                                   ObjcMethodDecl **clsMethods,
+                                   unsigned numClsMembers,
+                                   SourceLocation endLoc) {
   NumInstanceMethods = numInsMembers;
   if (numInsMembers) {
     InstanceMethods = new ObjcMethodDecl*[numInsMembers];
@@ -332,15 +335,17 @@
     ClassMethods = new ObjcMethodDecl*[numClsMembers];
     memcpy(ClassMethods, clsMethods, numClsMembers*sizeof(ObjcMethodDecl*));
   }
+  EndLoc = endLoc;
 }
 
-/// ObjcAddProtoMethods - Insert instance and methods declarations into
+/// addMethods - Insert instance and methods declarations into
 /// ObjcProtocolDecl's ProtoInsMethods and ProtoClsMethods fields.
 ///
-void ObjcProtocolDecl::ObjcAddProtoMethods(ObjcMethodDecl **insMethods, 
-                                           unsigned numInsMembers,
-                                           ObjcMethodDecl **clsMethods,
-                                           unsigned numClsMembers) {
+void ObjcProtocolDecl::addMethods(ObjcMethodDecl **insMethods, 
+                                  unsigned numInsMembers,
+                                  ObjcMethodDecl **clsMethods,
+                                  unsigned numClsMembers,
+                                  SourceLocation AtEndLoc) {
   NumInstanceMethods = numInsMembers;
   if (numInsMembers) {
     InstanceMethods = new ObjcMethodDecl*[numInsMembers];
@@ -353,13 +358,14 @@
   }
 }
 
-/// ObjcAddCat - Insert instance and methods declarations into
+/// addMethods - Insert instance and methods declarations into
 /// ObjcCategoryDecl's CatInsMethods and CatClsMethods fields.
 ///
-void ObjcCategoryDecl::ObjcAddCatMethods(ObjcMethodDecl **insMethods, 
-                                         unsigned numInsMembers,
-                                         ObjcMethodDecl **clsMethods,
-                                         unsigned numClsMembers) {
+void ObjcCategoryDecl::addMethods(ObjcMethodDecl **insMethods, 
+                                  unsigned numInsMembers,
+                                  ObjcMethodDecl **clsMethods,
+                                  unsigned numClsMembers,
+                                  SourceLocation AtEndLoc) {
   NumInstanceMethods = numInsMembers;
   if (numInsMembers) {
     InstanceMethods = new ObjcMethodDecl*[numInsMembers];
@@ -372,13 +378,14 @@
   }
 }
 
-/// ObjcAddCatImplMethods - Insert instance and methods declarations into
+/// addMethods - Insert instance and methods declarations into
 /// ObjcCategoryImplDecl's CatInsMethods and CatClsMethods fields.
 ///
-void ObjcCategoryImplDecl::ObjcAddCatImplMethods(ObjcMethodDecl **insMethods, 
-                                                 unsigned numInsMembers,
-                                                 ObjcMethodDecl **clsMethods,
-                                                 unsigned numClsMembers) {
+void ObjcCategoryImplDecl::addMethods(ObjcMethodDecl **insMethods, 
+                                      unsigned numInsMembers,
+                                      ObjcMethodDecl **clsMethods,
+                                      unsigned numClsMembers,
+                                      SourceLocation AtEndLoc) {
   NumInstanceMethods = numInsMembers;
   if (numInsMembers) {
     InstanceMethods = new ObjcMethodDecl*[numInsMembers];
@@ -394,10 +401,11 @@
 /// ObjcAddImplMethods - Insert instance and methods declarations into
 /// ObjcImplementationDecl's InsMethods and ClsMethods fields.
 ///
-void ObjcImplementationDecl::ObjcAddImplMethods(ObjcMethodDecl **insMethods, 
-                                                unsigned numInsMembers,
-                                                ObjcMethodDecl **clsMethods,
-                                                unsigned numClsMembers) {
+void ObjcImplementationDecl::addMethods(ObjcMethodDecl **insMethods, 
+                                        unsigned numInsMembers,
+                                        ObjcMethodDecl **clsMethods,
+                                        unsigned numClsMembers,
+                                        SourceLocation AtEndLoc) {
   NumInstanceMethods = numInsMembers;
   if (numInsMembers) {
     InstanceMethods = new ObjcMethodDecl*[numInsMembers];

Modified: cfe/trunk/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseDecl.cpp?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/Parse/ParseDecl.cpp Mon Oct 29 16:38:07 2007
@@ -758,10 +758,11 @@
     }
   }
   
-  MatchRHSPunctuation(tok::r_brace, LBraceLoc);
+  SourceLocation RBraceLoc = MatchRHSPunctuation(tok::r_brace, LBraceLoc);
   
   Actions.ActOnFields(CurScope,
-		      RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size());
+		      RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size(),
+                      LBraceLoc, RBraceLoc);
   
   AttributeList *AttrList = 0;
   // If attributes exist after struct contents, parse them.

Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Mon Oct 29 16:38:07 2007
@@ -193,7 +193,7 @@
                       ProtocolRefs.size(), attrList);
             
   if (Tok.is(tok::l_brace))
-    ParseObjCClassInstanceVariables(ClsType);
+    ParseObjCClassInstanceVariables(ClsType, atLoc);
 
   ParseObjCInterfaceDeclList(ClsType, tok::objc_interface);
 
@@ -222,12 +222,15 @@
 					tok::ObjCKeywordKind contextKey) {
   llvm::SmallVector<DeclTy*, 32>  allMethods;
   tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword;
+  SourceLocation AtEndLoc;
+  
   while (1) {
     if (Tok.is(tok::at)) {
       SourceLocation AtLoc = ConsumeToken(); // the "@"
       tok::ObjCKeywordKind ocKind = Tok.getObjCKeywordID();
       
       if (ocKind == tok::objc_end) { // terminate list
+        AtEndLoc = AtLoc;
         break;
       } else if (ocKind == tok::objc_required) { // protocols only
         ConsumeToken();
@@ -268,8 +271,8 @@
   }
   if (allMethods.size())
     /// Insert collected methods declarations into the @interface object.
-    Actions.ActOnAddMethodsToObjcDecl(CurScope, interfaceDecl,
-                                      &allMethods[0], allMethods.size());
+    Actions.ActOnAddMethodsToObjcDecl(CurScope, interfaceDecl, &allMethods[0], 
+                                      allMethods.size(), AtEndLoc);
 }
 
 ///   Parse property attribute declarations.
@@ -683,7 +686,8 @@
 ///   objc-instance-variable-decl:
 ///     struct-declaration 
 ///
-void Parser::ParseObjCClassInstanceVariables(DeclTy *interfaceDecl) {
+void Parser::ParseObjCClassInstanceVariables(DeclTy *interfaceDecl,
+                                             SourceLocation atLoc) {
   assert(Tok.is(tok::l_brace) && "expected {");
   llvm::SmallVector<DeclTy*, 16> IvarDecls;
   llvm::SmallVector<DeclTy*, 32> AllIvarDecls;
@@ -737,12 +741,12 @@
       SkipUntil(tok::r_brace, true, true);
     }
   }
+  SourceLocation RBraceLoc = MatchRHSPunctuation(tok::r_brace, LBraceLoc);
   if (AllIvarDecls.size()) {  // Check for {} - no ivars in braces
-    Actions.ActOnFields(CurScope, LBraceLoc, interfaceDecl, 
+    Actions.ActOnFields(CurScope, atLoc, interfaceDecl,
                         &AllIvarDecls[0], AllIvarDecls.size(),
-                        &AllVisibilities[0]);
+                        LBraceLoc, RBraceLoc, &AllVisibilities[0]);
   }
-  MatchRHSPunctuation(tok::r_brace, LBraceLoc);
   return;
 }
 
@@ -893,11 +897,12 @@
 				  atLoc, nameId, nameLoc,
                                   superClassId, superClassLoc);
   
-  if (Tok.is(tok::l_brace))
-    ParseObjCClassInstanceVariables(ImplClsType/*FIXME*/); // we have ivars
+  if (Tok.is(tok::l_brace)) // we have ivars
+    ParseObjCClassInstanceVariables(ImplClsType/*FIXME*/, atLoc);
   
   return ImplClsType;
 }
+
 Parser::DeclTy *Parser::ParseObjCAtEndDeclaration(SourceLocation atLoc) {
   assert(Tok.isObjCAtKeyword(tok::objc_end) &&
          "ParseObjCAtEndDeclaration(): Expected @end");
@@ -908,7 +913,8 @@
     // could be 0.
     /// Insert collected methods declarations into the @interface object.
     Actions.ActOnAddMethodsToObjcDecl(CurScope, ObjcImpDecl,
-                                      &AllImplMethods[0],AllImplMethods.size());
+                                      &AllImplMethods[0], AllImplMethods.size(),
+                                      atLoc);
     ObjcImpDecl = 0;
     AllImplMethods.clear();
   }

Modified: cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.h?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/Sema/Sema.h (original)
+++ cfe/trunk/Sema/Sema.h Mon Oct 29 16:38:07 2007
@@ -203,9 +203,10 @@
                                       
   // This is used for both record definitions and ObjC interface declarations.
   virtual void ActOnFields(Scope* S,
-				 SourceLocation RecLoc, DeclTy *TagDecl,
-                                 DeclTy **Fields, unsigned NumFields,
-                                 tok::ObjCKeywordKind *visibility = 0);
+                           SourceLocation RecLoc, DeclTy *TagDecl,
+                           DeclTy **Fields, unsigned NumFields,
+                           SourceLocation LBrac, SourceLocation RBrac,
+                           tok::ObjCKeywordKind *visibility = 0);
   virtual DeclTy *ActOnEnumConstant(Scope *S, DeclTy *EnumDecl,
                                     DeclTy *LastEnumConstant,
                                     SourceLocation IdLoc, IdentifierInfo *Id,
@@ -517,7 +518,8 @@
                                        Protocols);
 
   virtual void ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *ClassDecl, 
-				         DeclTy **allMethods, unsigned allNum);
+				         DeclTy **allMethods, unsigned allNum,
+                                         SourceLocation AtEndLoc);
   
   virtual DeclTy *ActOnMethodDeclaration(
     SourceLocation BeginLoc, // location of the + or -.

Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Mon Oct 29 16:38:07 2007
@@ -1263,7 +1263,7 @@
   /// (legacy objective-c @implementation decl without an @interface decl).
   /// Add implementations's ivar to the synthesize class's ivar list.
   if (IDecl->ImplicitInterfaceDecl()) {
-    IDecl->ObjcAddInstanceVariablesToClass(ivars, numIvars);
+    IDecl->addInstanceVariablesToClass(ivars, numIvars, SourceLocation());
     return;
   }
   
@@ -1631,6 +1631,7 @@
 void Sema::ActOnFields(Scope* S,
                        SourceLocation RecLoc, DeclTy *RecDecl,
                        DeclTy **Fields, unsigned NumFields,
+                       SourceLocation LBrac, SourceLocation RBrac,
                        tok::ObjCKeywordKind *visibility) {
   Decl *EnclosingDecl = static_cast<Decl*>(RecDecl);
   assert(EnclosingDecl && "missing record or interface decl");
@@ -1769,7 +1770,7 @@
                     reinterpret_cast<ObjcIvarDecl**>(&RecFields[0]);
     if (isa<ObjcInterfaceDecl>(static_cast<Decl*>(RecDecl)))
       cast<ObjcInterfaceDecl>(static_cast<Decl*>(RecDecl))->
-        ObjcAddInstanceVariablesToClass(ClsFields, RecFields.size());
+        addInstanceVariablesToClass(ClsFields, RecFields.size(), RBrac);
     else if (isa<ObjcImplementationDecl>(static_cast<Decl*>(RecDecl))) {
       ObjcImplementationDecl* IMPDecl = 
         cast<ObjcImplementationDecl>(static_cast<Decl*>(RecDecl));
@@ -1844,7 +1845,8 @@
 }
 
 void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl,
-                                     DeclTy **allMethods, unsigned allNum) {
+                                     DeclTy **allMethods, unsigned allNum,
+                                     SourceLocation AtEndLoc) {
   Decl *ClassDecl = static_cast<Decl *>(classDecl);
 
   // FIXME: If we don't have a ClassDecl, we have an error. I (snaroff) would
@@ -1906,26 +1908,26 @@
   }
   
   if (ObjcInterfaceDecl *I = dyn_cast<ObjcInterfaceDecl>(ClassDecl)) {
-    I->ObjcAddMethods(&insMethods[0], insMethods.size(),
-                      &clsMethods[0], clsMethods.size());
+    I->addMethods(&insMethods[0], insMethods.size(),
+                  &clsMethods[0], clsMethods.size(), AtEndLoc);
   } else if (ObjcProtocolDecl *P = dyn_cast<ObjcProtocolDecl>(ClassDecl)) {
-    P->ObjcAddProtoMethods(&insMethods[0], insMethods.size(),
-                           &clsMethods[0], clsMethods.size());
+    P->addMethods(&insMethods[0], insMethods.size(),
+                  &clsMethods[0], clsMethods.size(), AtEndLoc);
   }
   else if (ObjcCategoryDecl *C = dyn_cast<ObjcCategoryDecl>(ClassDecl)) {
-    C->ObjcAddCatMethods(&insMethods[0], insMethods.size(),
-                         &clsMethods[0], clsMethods.size());
+    C->addMethods(&insMethods[0], insMethods.size(),
+                  &clsMethods[0], clsMethods.size(), AtEndLoc);
   }
   else if (ObjcImplementationDecl *IC = 
                 dyn_cast<ObjcImplementationDecl>(ClassDecl)) {
-    IC->ObjcAddImplMethods(&insMethods[0], insMethods.size(),
-                           &clsMethods[0], clsMethods.size());
+    IC->addMethods(&insMethods[0], insMethods.size(),
+                   &clsMethods[0], clsMethods.size(), AtEndLoc);
     if (ObjcInterfaceDecl* IDecl = getObjCInterfaceDecl(IC->getIdentifier()))
       ImplMethodsVsClassMethods(IC, IDecl);
   } else {
     ObjcCategoryImplDecl* CatImplClass = cast<ObjcCategoryImplDecl>(ClassDecl);
-    CatImplClass->ObjcAddCatImplMethods(&insMethods[0], insMethods.size(),
-                                        &clsMethods[0], clsMethods.size());
+    CatImplClass->addMethods(&insMethods[0], insMethods.size(),
+                             &clsMethods[0], clsMethods.size(), AtEndLoc);
     ObjcInterfaceDecl* IDecl = CatImplClass->getClassInterface();
     // Find category interface decl and then check that all methods declared
     // in this interface is implemented in the category @implementation.

Modified: cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/trunk/clang.xcodeproj/project.pbxproj Mon Oct 29 16:38:07 2007
@@ -756,7 +756,6 @@
 		08FB7793FE84155DC02AAC07 /* Project object */ = {
 			isa = PBXProject;
 			buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
-			compatibilityVersion = "Xcode 2.4";
 			hasScannedForEncodings = 1;
 			mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
 			projectDirPath = "";

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Mon Oct 29 16:38:07 2007
@@ -73,10 +73,13 @@
   ObjcCategoryDecl *CategoryList;
   
   bool ForwardDecl; // declared with @class.
+  
+  SourceLocation RBracLoc; // marks the end of the instance variables.
+  SourceLocation EndLoc; // marks the end of the entire interface.
 public:
-  ObjcInterfaceDecl(SourceLocation L, unsigned numRefProtos,
+  ObjcInterfaceDecl(SourceLocation atLoc, unsigned numRefProtos,
                     IdentifierInfo *Id, bool FD = false)
-    : TypeDecl(ObjcInterface, L, Id, 0), SuperClass(0),
+    : TypeDecl(ObjcInterface, atLoc, Id, 0), SuperClass(0),
       ReferencedProtocols(0), NumReferencedProtocols(-1), Ivars(0), 
       NumIvars(-1),
       InstanceMethods(0), NumInstanceMethods(-1), 
@@ -109,11 +112,12 @@
   ObjcMethodDecl** getClassMethods() const { return ClassMethods; }
   int getNumClassMethods() const { return NumClassMethods; }
   
-  void ObjcAddInstanceVariablesToClass(ObjcIvarDecl **ivars, 
-				       unsigned numIvars);
+  void addInstanceVariablesToClass(ObjcIvarDecl **ivars, unsigned numIvars,
+                                   SourceLocation RBracLoc);
 
-  void ObjcAddMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
-                      ObjcMethodDecl **clsMethods, unsigned numClsMembers);
+  void addMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
+                  ObjcMethodDecl **clsMethods, unsigned numClsMembers,
+                  SourceLocation AtEnd);
   
   bool isForwardDecl() const { return ForwardDecl; }
   void setForwardDecl(bool val) { ForwardDecl = val; }
@@ -132,6 +136,14 @@
   }
   ObjcMethodDecl *lookupInstanceMethod(Selector &Sel);
   ObjcMethodDecl *lookupClassMethod(Selector &Sel);
+
+  // Location information, modeled after the Stmt API. For interfaces, 
+  // which are fairly course grain, the end refers to the '}' token.
+  SourceLocation getLocStart() const { return getLocation(); } // '@'interface
+  SourceLocation getLocEnd() const { return RBracLoc; }
+  
+  // We also need to record the @end location.
+  SourceLocation getAtEndLoc() const { return EndLoc; }
   
   /// ImplicitInterfaceDecl - check that this is an implicitely declared
   /// ObjcInterfaceDecl node. This is for legacy objective-c @implementation
@@ -313,8 +325,9 @@
       NumReferencedProtocols = numRefProtos;
     }    
   }
-  void ObjcAddProtoMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
-                           ObjcMethodDecl **clsMethods, unsigned numClsMembers);
+  void addMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
+                  ObjcMethodDecl **clsMethods, unsigned numClsMembers,
+                  SourceLocation AtEndLoc);
   
   void setReferencedProtocols(int idx, ObjcProtocolDecl *OID) {
     assert((idx < NumReferencedProtocols) && "index out of range");
@@ -480,8 +493,9 @@
   ObjcMethodDecl **getClassMethods() const { return ClassMethods; }
   int getNumClassMethods() const { return NumClassMethods; }
   
-  void ObjcAddCatMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
-                         ObjcMethodDecl **clsMethods, unsigned numClsMembers);
+  void addMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
+                  ObjcMethodDecl **clsMethods, unsigned numClsMembers,
+                  SourceLocation AtEndLoc);
   
   ObjcCategoryDecl *getNextClassCategory() const { return NextClassCategory; }
   void insertNextClassCategory() {
@@ -525,9 +539,9 @@
   ObjcMethodDecl **getClassMethods() const { return ClassMethods; }
   int getNumClassMethods() const { return NumClassMethods; }
   
-  void ObjcAddCatImplMethods(
-        ObjcMethodDecl **insMethods, unsigned numInsMembers,
-        ObjcMethodDecl **clsMethods, unsigned numClsMembers);
+  void addMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
+                  ObjcMethodDecl **clsMethods, unsigned numClsMembers,
+                  SourceLocation AtEndLoc);
   
   static bool classof(const Decl *D) { return D->getKind() == ObjcCategoryImpl;}
   static bool classof(const ObjcCategoryImplDecl *D) { return true; }
@@ -581,8 +595,9 @@
   void ObjcAddInstanceVariablesToClassImpl(ObjcIvarDecl **ivars, 
                                            unsigned numIvars);
     
-  void ObjcAddImplMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
-                          ObjcMethodDecl **clsMethods, unsigned numClsMembers);
+  void addMethods(ObjcMethodDecl **insMethods, unsigned numInsMembers,
+                  ObjcMethodDecl **clsMethods, unsigned numClsMembers,
+                  SourceLocation AtEndLoc);
     
   ObjcInterfaceDecl *getClassInterface() const { return ClassInterface; }
   ObjcInterfaceDecl *getSuperClass() const { return SuperClass; }

Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Mon Oct 29 16:38:07 2007
@@ -180,10 +180,10 @@
                              Declarator &D, ExprTy *BitfieldWidth) {
     return 0;
   }
-  virtual void ActOnFields(Scope* S,
-				 SourceLocation RecLoc, DeclTy *TagDecl,
-                                 DeclTy **Fields, unsigned NumFields,
-                                 tok::ObjCKeywordKind *visibility = 0) {}
+  virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclTy *TagDecl,
+                           DeclTy **Fields, unsigned NumFields, 
+                           SourceLocation LBrac, SourceLocation RBrac,
+                           tok::ObjCKeywordKind *visibility = 0) {}
   virtual DeclTy *ActOnEnumConstant(Scope *S, DeclTy *EnumDecl,
                                     DeclTy *LastEnumConstant,
                                     SourceLocation IdLoc, IdentifierInfo *Id,
@@ -541,7 +541,8 @@
     Scope* S, 
     DeclTy *ClassDecl,
     DeclTy **allMethods, 
-    unsigned allNum) {
+    unsigned allNum,
+    SourceLocation AtEndLoc) {
     return;
   }
   // ActOnClassMessage - used for both unary and keyword messages.

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=43475&r1=43474&r2=43475&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Mon Oct 29 16:38:07 2007
@@ -258,7 +258,8 @@
   DeclTy *ParseObjCAtClassDeclaration(SourceLocation atLoc);
   DeclTy *ParseObjCAtInterfaceDeclaration(SourceLocation atLoc, 
                                           AttributeList *prefixAttrs = 0);
-  void ParseObjCClassInstanceVariables(DeclTy *interfaceDecl);
+  void ParseObjCClassInstanceVariables(DeclTy *interfaceDecl, 
+                                       SourceLocation atLoc);
   bool ParseObjCProtocolReferences(llvm::SmallVectorImpl<IdentifierInfo*> &);
   void ParseObjCInterfaceDeclList(DeclTy *interfaceDecl,
 				  tok::ObjCKeywordKind contextKey);





More information about the cfe-commits mailing list