summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Rewrite/Frontend')
-rw-r--r--clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp9
-rw-r--r--clang/lib/Rewrite/Frontend/RewriteObjC.cpp9
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;
OpenPOWER on IntegriCloud