diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-21 21:32:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-21 21:32:27 +0000 |
commit | 780f329cb011bff0da5763e2e9744eec093d0509 (patch) | |
tree | 9d66381fd365b73a2f582250172ee64d77cc3762 /lib/CodeGen/CodeGenModule.cpp | |
parent | dbddbe4da4ed6fd4c37b865fcbbddea5428cc32c (diff) |
move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
simplifying code along the way and fixing a problem and memory leak or two.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index b9c15427c3..f2112ebd72 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -362,14 +362,15 @@ void CodeGenModule::EmitObjCMethod(const ObjCMethodDecl *OMD) { } void CodeGenModule::EmitObjCProtocolImplementation(const ObjCProtocolDecl *PD){ llvm::SmallVector<std::string, 16> Protocols; - for (unsigned i = 0, e = PD->getNumReferencedProtocols() ; i < e ; i++) - Protocols.push_back(PD->getReferencedProtocols()[i]->getName()); + for (ObjCProtocolDecl::protocol_iterator PI = PD->protocol_begin(), + E = PD->protocol_end(); PI != E; ++PI) + Protocols.push_back((*PI)->getName()); llvm::SmallVector<llvm::Constant*, 16> InstanceMethodNames; llvm::SmallVector<llvm::Constant*, 16> InstanceMethodTypes; for (ObjCProtocolDecl::instmeth_iterator iter = PD->instmeth_begin(), - endIter = PD->instmeth_end() ; iter != endIter ; iter++) { + E = PD->instmeth_end(); iter != E; iter++) { std::string TypeStr; - Context.getObjCEncodingForMethodDecl((*iter),TypeStr); + Context.getObjCEncodingForMethodDecl(*iter, TypeStr); InstanceMethodNames.push_back( GetAddrOfConstantString((*iter)->getSelector().getName())); InstanceMethodTypes.push_back(GetAddrOfConstantString(TypeStr)); |