diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 19:50:17 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 19:50:17 +0000 |
commit | f26acce6f74658f8ab7ec3b0325363c228ffc5ae (patch) | |
tree | 208231a17e854281d810ed4e53e53da7f98ac57f /clang/lib/CodeGen/CGObjCGNU.cpp | |
parent | 514fc61c091d985c561d5a60166a96f772461131 (diff) | |
download | bcm5719-llvm-f26acce6f74658f8ab7ec3b0325363c228ffc5ae.tar.gz bcm5719-llvm-f26acce6f74658f8ab7ec3b0325363c228ffc5ae.zip |
[C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203839
Diffstat (limited to 'clang/lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjCGNU.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp index a8481ed7a82..e55f6056417 100644 --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/lib/CodeGen/CGObjCGNU.cpp @@ -1762,17 +1762,16 @@ void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) { SmallVector<llvm::Constant*, 16> InstanceMethodTypes; SmallVector<llvm::Constant*, 16> OptionalInstanceMethodNames; SmallVector<llvm::Constant*, 16> OptionalInstanceMethodTypes; - for (ObjCProtocolDecl::instmeth_iterator iter = PD->instmeth_begin(), - E = PD->instmeth_end(); iter != E; iter++) { + for (const auto *I : PD->instance_methods()) { std::string TypeStr; - Context.getObjCEncodingForMethodDecl(*iter, TypeStr); - if ((*iter)->getImplementationControl() == ObjCMethodDecl::Optional) { + Context.getObjCEncodingForMethodDecl(I, TypeStr); + if (I->getImplementationControl() == ObjCMethodDecl::Optional) { OptionalInstanceMethodNames.push_back( - MakeConstantString((*iter)->getSelector().getAsString())); + MakeConstantString(I->getSelector().getAsString())); OptionalInstanceMethodTypes.push_back(MakeConstantString(TypeStr)); } else { InstanceMethodNames.push_back( - MakeConstantString((*iter)->getSelector().getAsString())); + MakeConstantString(I->getSelector().getAsString())); InstanceMethodTypes.push_back(MakeConstantString(TypeStr)); } } @@ -2004,12 +2003,10 @@ void CGObjCGNU::GenerateCategory(const ObjCCategoryImplDecl *OCD) { // Collect information about instance methods SmallVector<Selector, 16> InstanceMethodSels; SmallVector<llvm::Constant*, 16> InstanceMethodTypes; - for (ObjCCategoryImplDecl::instmeth_iterator - iter = OCD->instmeth_begin(), endIter = OCD->instmeth_end(); - iter != endIter ; iter++) { - InstanceMethodSels.push_back((*iter)->getSelector()); + for (const auto *I : OCD->instance_methods()) { + InstanceMethodSels.push_back(I->getSelector()); std::string TypeStr; - CGM.getContext().getObjCEncodingForMethodDecl(*iter,TypeStr); + CGM.getContext().getObjCEncodingForMethodDecl(I,TypeStr); InstanceMethodTypes.push_back(MakeConstantString(TypeStr)); } @@ -2237,12 +2234,10 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) { // Collect information about instance methods SmallVector<Selector, 16> InstanceMethodSels; SmallVector<llvm::Constant*, 16> InstanceMethodTypes; - for (ObjCImplementationDecl::instmeth_iterator - iter = OID->instmeth_begin(), endIter = OID->instmeth_end(); - iter != endIter ; iter++) { - InstanceMethodSels.push_back((*iter)->getSelector()); + for (const auto *I : OID->instance_methods()) { + InstanceMethodSels.push_back(I->getSelector()); std::string TypeStr; - Context.getObjCEncodingForMethodDecl((*iter),TypeStr); + Context.getObjCEncodingForMethodDecl(I,TypeStr); InstanceMethodTypes.push_back(MakeConstantString(TypeStr)); } |