diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 22:58:06 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 22:58:06 +0000 |
commit | 0f6e64d50511aeab55ed6929d8bc1953b776bb92 (patch) | |
tree | 809e302691a93f939b33e1eff7ccd8925c8a84d7 /clang/lib/Rewrite | |
parent | 9b8f9c3d95c40bbe4e575929d97ad8b3cce7244e (diff) | |
download | bcm5719-llvm-0f6e64d50511aeab55ed6929d8bc1953b776bb92.tar.gz bcm5719-llvm-0f6e64d50511aeab55ed6929d8bc1953b776bb92.zip |
[C++11] Replacing ObjCProtocolDecl 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: 203863
Diffstat (limited to 'clang/lib/Rewrite')
-rw-r--r-- | clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp index f14039272be..39395437b66 100644 --- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -6996,9 +6996,8 @@ void RewriteModernObjC::RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl, PDecl = Def; // Must write out all protocol definitions in current qualifier list, // and in their nested qualifiers before writing out current definition. - for (ObjCProtocolDecl::protocol_iterator I = PDecl->protocol_begin(), - E = PDecl->protocol_end(); I != E; ++I) - RewriteObjCProtocolMetaData(*I, Result); + for (auto *I : PDecl->protocols()) + RewriteObjCProtocolMetaData(I, Result); // Construct method lists. std::vector<ObjCMethodDecl *> InstanceMethods, ClassMethods; @@ -7033,11 +7032,7 @@ void RewriteModernObjC::RewriteObjCProtocolMetaData(ObjCProtocolDecl *PDecl, "_OBJC_PROTOCOL_METHOD_TYPES_", PDecl->getNameAsString()); // Protocol's super protocol list - std::vector<ObjCProtocolDecl *> SuperProtocols; - for (ObjCProtocolDecl::protocol_iterator I = PDecl->protocol_begin(), - E = PDecl->protocol_end(); I != E; ++I) - SuperProtocols.push_back(*I); - + SmallVector<ObjCProtocolDecl *, 8> SuperProtocols(PDecl->protocols()); Write_protocol_list_initializer(Context, Result, SuperProtocols, "_OBJC_PROTOCOL_REFS_", PDecl->getNameAsString()); |