Fixed a regression caused by refactoring of some meta-data generation routines using iteratgors.
Also fixed indentation problems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45105 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index 780fbc5..87ebef4 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -1848,27 +1848,30 @@
         objc_protocol_methods = true;
       }
       
-	  int NumMethods = PDecl->getNumInstanceMethods();
-	  if(NumMethods > 0) {
+      int NumMethods = PDecl->getNumInstanceMethods();
+      if(NumMethods > 0) {
         Result += "\nstatic struct _objc_protocol_method_list "
                "_OBJC_PROTOCOL_INSTANCE_METHODS_";
         Result += PDecl->getName();
         Result += " __attribute__ ((section (\"__OBJC, __cat_inst_meth\")))= "
           "{\n\t" + utostr(NumMethods) + "\n";
         
-		// Output instance methods declared in this protocol.
-		for (ObjcProtocolDecl::instmeth_iterator I = PDecl->instmeth_begin(), 
-			 E = PDecl->instmeth_end(); I != E; ++I) {
-		  Result += "\t  ,{(SEL)\"";
-		  Result += (*I)->getSelector().getName().c_str();
-		  std::string MethodTypeString;
-		  Context->getObjcEncodingForMethodDecl((*I), MethodTypeString);
-		  Result += "\", \"";
-		  Result += MethodTypeString;
-		  Result += "\"}\n";
-		}
-		Result += "\t }\n};\n";
-	  }
+        // Output instance methods declared in this protocol.
+        for (ObjcProtocolDecl::instmeth_iterator I = PDecl->instmeth_begin(), 
+             E = PDecl->instmeth_end(); I != E; ++I) {
+          if (I == PDecl->instmeth_begin())
+            Result += "\t  ,{{(SEL)\"";
+          else
+            Result += "\t  ,{(SEL)\"";
+          Result += (*I)->getSelector().getName().c_str();
+          std::string MethodTypeString;
+          Context->getObjcEncodingForMethodDecl((*I), MethodTypeString);
+          Result += "\", \"";
+          Result += MethodTypeString;
+          Result += "\"}\n";
+        }
+        Result += "\t }\n};\n";
+      }
       
       // Output class methods declared in this protocol.
       NumMethods = PDecl->getNumClassMethods();