summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-14 18:34:04 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-14 18:34:04 +0000
commit6440fd75532002285ee55bb4c81cfb8190456130 (patch)
treeff769c5ecab365e0a4f98fecfc695e91afb2975b /lib/CodeGen/CGDecl.cpp
parentba42b0bca2698ffb3a878c98017d494aba3ee5ff (diff)
downloadclang-6440fd75532002285ee55bb4c81cfb8190456130.tar.gz
clang-6440fd75532002285ee55bb4c81cfb8190456130.tar.bz2
clang-6440fd75532002285ee55bb4c81cfb8190456130.tar.xz
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 4b063c49c7..cf1c36675e 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -530,9 +530,8 @@ static bool isAccessedBy(const VarDecl &var, const Stmt *s) {
return (ref->getDecl() == &var);
if (const BlockExpr *be = dyn_cast<BlockExpr>(e)) {
const BlockDecl *block = be->getBlockDecl();
- for (BlockDecl::capture_const_iterator i = block->capture_begin(),
- e = block->capture_end(); i != e; ++i) {
- if (i->getVariable() == &var)
+ for (const auto &I : block->captures()) {
+ if (I.getVariable() == &var)
return true;
}
}
@@ -993,9 +992,8 @@ static bool isCapturedBy(const VarDecl &var, const Expr *e) {
if (const BlockExpr *be = dyn_cast<BlockExpr>(e)) {
const BlockDecl *block = be->getBlockDecl();
- for (BlockDecl::capture_const_iterator i = block->capture_begin(),
- e = block->capture_end(); i != e; ++i) {
- if (i->getVariable() == &var)
+ for (const auto &I : block->captures()) {
+ if (I.getVariable() == &var)
return true;
}