From 3db6cae19c236fe2cef343c90105ce7cca7de965 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 21 Jul 2008 18:19:38 +0000 Subject: 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 --- lib/CodeGen/CodeGenModule.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') 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 Protocols; - ObjCInterfaceDecl * ClassDecl = (ObjCInterfaceDecl*)OCD->getClassInterface(); - for (unsigned i=0 ; igetNumIntfRefProtocols() ; i++) - Protocols.push_back(ClassDecl->getReferencedProtocols()[i]->getName()); + const ObjCInterfaceDecl *ClassDecl = OCD->getClassInterface(); + const ObjCList &Protos =ClassDecl->getReferencedProtocols(); + for (ObjCList::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 Protocols; - for (unsigned i = 0, e = ClassDecl->getNumIntfRefProtocols() ; i < e ; i++) - Protocols.push_back(ClassDecl->getReferencedProtocols()[i]->getName()); + const ObjCList &Protos =ClassDecl->getReferencedProtocols(); + for (ObjCList::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, -- cgit v1.2.3-18-g5258