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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43475 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index 30ca5e6..804e9cc 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -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];