summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-07-21 18:19:38 +0000
committerChris Lattner <sabre@nondot.org>2008-07-21 18:19:38 +0000
commitd004505b7491a5b0018575d7ebd747eae3c9d845 (patch)
tree0ef06a1429afa04095309fb01084756d59cff13a /clang/lib/CodeGen/CodeGenModule.cpp
parentb47772535be4cb04dc8682f849cf70e68ceb8a51 (diff)
downloadbcm5719-llvm-d004505b7491a5b0018575d7ebd747eae3c9d845.tar.gz
bcm5719-llvm-d004505b7491a5b0018575d7ebd747eae3c9d845.zip
introduce a new ObjCList templated class and start moving
various objc lists over to it. First up, the protocol list on ObjCInterfaceDecl. llvm-svn: 53856
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 20afc5eb12e..b9c15427c3f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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,
OpenPOWER on IntegriCloud