diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-21 18:19:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-21 18:19:38 +0000 |
commit | 3db6cae19c236fe2cef343c90105ce7cca7de965 (patch) | |
tree | f11dfa61672801a7fcafaf85b26c49d681403a2e /lib/CodeGen/CodeGenModule.cpp | |
parent | fcde95db82567564e2f9983b8d1acef99214f347 (diff) |
introduce a new ObjCList templated class and start moving
various objc lists over to it. First up, the protocol list
on ObjCInterfaceDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 20afc5eb12..b9c15427c3 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -415,9 +415,11 @@ void CodeGenModule::EmitObjCCategoryImpl(const ObjCCategoryImplDecl *OCD) { // Collect the names of referenced protocols llvm::SmallVector<std::string, 16> Protocols; - ObjCInterfaceDecl * ClassDecl = (ObjCInterfaceDecl*)OCD->getClassInterface(); - for (unsigned i=0 ; i<ClassDecl->getNumIntfRefProtocols() ; i++) - Protocols.push_back(ClassDecl->getReferencedProtocols()[i]->getName()); + const ObjCInterfaceDecl *ClassDecl = OCD->getClassInterface(); + const ObjCList<ObjCProtocolDecl> &Protos =ClassDecl->getReferencedProtocols(); + for (ObjCList<ObjCProtocolDecl>::iterator I = Protos.begin(), + E = Protos.end(); I != E; ++I) + Protocols.push_back((*I)->getName()); // Generate the category Runtime->GenerateCategory(OCD->getClassInterface()->getName(), @@ -495,8 +497,10 @@ void CodeGenModule::EmitObjCClassImplementation( } // Collect the names of referenced protocols llvm::SmallVector<std::string, 16> Protocols; - for (unsigned i = 0, e = ClassDecl->getNumIntfRefProtocols() ; i < e ; i++) - Protocols.push_back(ClassDecl->getReferencedProtocols()[i]->getName()); + const ObjCList<ObjCProtocolDecl> &Protos =ClassDecl->getReferencedProtocols(); + for (ObjCList<ObjCProtocolDecl>::iterator I = Protos.begin(), + E = Protos.end(); I != E; ++I) + Protocols.push_back((*I)->getName()); // Generate the category Runtime->GenerateClass(ClassName, SCName, instanceSize, IvarNames, IvarTypes, |