[cfe-commits] r45105 - /cfe/trunk/Driver/RewriteTest.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Dec 17 09:56:11 PST 2007


Author: fjahanian
Date: Mon Dec 17 11:56:10 2007
New Revision: 45105

URL: http://llvm.org/viewvc/llvm-project?rev=45105&view=rev
Log:
Fixed a regression caused by refactoring of some meta-data generation routines using iteratgors.
Also fixed indentation problems.

Modified:
    cfe/trunk/Driver/RewriteTest.cpp

Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=45105&r1=45104&r2=45105&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Mon Dec 17 11:56:10 2007
@@ -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();





More information about the cfe-commits mailing list