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 | 390d39ac7e5e773c571f776dde1bbe3c9ed91e98 (patch) | |
tree | ee7d0dde7f285685136a23a8994b6a18d62437ca /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | f1dc362547702837ed79156416d84fd8ba259780 (diff) | |
download | bcm5719-llvm-390d39ac7e5e773c571f776dde1bbe3c9ed91e98.tar.gz bcm5719-llvm-390d39ac7e5e773c571f776dde1bbe3c9ed91e98.zip |
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.
llvm-svn: 53876
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b9c15427c3f..f2112ebd721 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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)); |