diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2007-12-17 17:56:10 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2007-12-17 17:56:10 +0000 |
commit | fc591acc68050ab882fd242f0df2ad9196a1f3d7 (patch) | |
tree | 0e458f82b03001ef990557df71fb781f9ddf9607 /Driver/RewriteTest.cpp | |
parent | 7c1d3df338b28a968df8f73f2b56b718514385fd (diff) |
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
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r-- | Driver/RewriteTest.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp index 780fbc555e..87ebef4e87 100644 --- a/Driver/RewriteTest.cpp +++ b/Driver/RewriteTest.cpp @@ -1848,27 +1848,30 @@ void RewriteTest::RewriteObjcProtocolsMetaData(ObjcProtocolDecl **Protocols, 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(); |