summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-14 12:55:57 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-14 12:55:57 +0000
commit19a417699fd985cb31eef88e47088d7436f149bf (patch)
treec5a2de1b591629ec6b2fda4880806712ef137079 /clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
parentf445399870e5d3e70be72db0e5ac6aa4d581d8ca (diff)
downloadbcm5719-llvm-19a417699fd985cb31eef88e47088d7436f149bf.tar.gz
bcm5719-llvm-19a417699fd985cb31eef88e47088d7436f149bf.zip
[C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203922
Diffstat (limited to 'clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp')
-rw-r--r--clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
index 39395437b66..369383e0dad 100644
--- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
+++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
@@ -7505,16 +7505,11 @@ void RewriteModernObjC::RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *IDecl,
// Protocols referenced in class declaration?
// Protocol's super protocol list
- std::vector<ObjCProtocolDecl *> RefedProtocols;
- for (ObjCCategoryDecl::protocol_iterator I = CDecl->protocol_begin(),
- E = CDecl->protocol_end();
-
- I != E; ++I) {
- RefedProtocols.push_back(*I);
+ SmallVector<ObjCProtocolDecl *, 8> RefedProtocols(CDecl->protocols());
+ for (auto *I : CDecl->protocols())
// Must write out all protocol definitions in current qualifier list,
// and in their nested qualifiers before writing out current definition.
- RewriteObjCProtocolMetaData(*I, Result);
- }
+ RewriteObjCProtocolMetaData(I, Result);
Write_protocol_list_initializer(Context, Result,
RefedProtocols,
OpenPOWER on IntegriCloud