diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-14 18:34:04 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-14 18:34:04 +0000 |
commit | 9371dd2287d35b63193f1f01329e6f7af368d966 (patch) | |
tree | a5774aa255e93ba82568bb564b389ef8fc0cd4f8 /clang/lib/Rewrite/Frontend | |
parent | 84e0723af89eeea211cfd9fce7edf0cbb70ca483 (diff) | |
download | bcm5719-llvm-9371dd2287d35b63193f1f01329e6f7af368d966.tar.gz bcm5719-llvm-9371dd2287d35b63193f1f01329e6f7af368d966.zip |
[C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203958
Diffstat (limited to 'clang/lib/Rewrite/Frontend')
-rw-r--r-- | clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp | 9 | ||||
-rw-r--r-- | clang/lib/Rewrite/Frontend/RewriteObjC.cpp | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp index 93e89a91ad6..dfdc0f6340d 100644 --- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -5509,11 +5509,10 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp, SourceLocation()); bool isNestedCapturedVar = false; if (block) - for (BlockDecl::capture_const_iterator ci = block->capture_begin(), - ce = block->capture_end(); ci != ce; ++ci) { - const VarDecl *variable = ci->getVariable(); - if (variable == ND && ci->isNested()) { - assert (ci->isByRef() && + for (const auto &CI : block->captures()) { + const VarDecl *variable = CI.getVariable(); + if (variable == ND && CI.isNested()) { + assert (CI.isByRef() && "SynthBlockInitExpr - captured block variable is not byref"); isNestedCapturedVar = true; break; diff --git a/clang/lib/Rewrite/Frontend/RewriteObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteObjC.cpp index 4cd71d89f15..96780c045ed 100644 --- a/clang/lib/Rewrite/Frontend/RewriteObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteObjC.cpp @@ -4559,11 +4559,10 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp, SourceLocation()); bool isNestedCapturedVar = false; if (block) - for (BlockDecl::capture_const_iterator ci = block->capture_begin(), - ce = block->capture_end(); ci != ce; ++ci) { - const VarDecl *variable = ci->getVariable(); - if (variable == ND && ci->isNested()) { - assert (ci->isByRef() && + for (const auto &CI : block->captures()) { + const VarDecl *variable = CI.getVariable(); + if (variable == ND && CI.isNested()) { + assert (CI.isByRef() && "SynthBlockInitExpr - captured block variable is not byref"); isNestedCapturedVar = true; break; |