diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-14 17:01:24 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-14 17:01:24 +0000 |
| commit | 47aa3ca54bb0e2103306fda97af0de9a7efa5012 (patch) | |
| tree | 128f80273edc0f256409ac941c590fd2356eb85d /lib/CodeGen/CGDecl.cpp | |
| parent | 7f99d73c9fffc86a626a576656909f0bd2a2ffd2 (diff) | |
| download | clang-47aa3ca54bb0e2103306fda97af0de9a7efa5012.tar.gz clang-47aa3ca54bb0e2103306fda97af0de9a7efa5012.tar.bz2 clang-47aa3ca54bb0e2103306fda97af0de9a7efa5012.tar.xz | |
[C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203947 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
| -rw-r--r-- | lib/CodeGen/CGDecl.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 1f0dd8535a..4b063c49c7 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -1013,10 +1013,9 @@ static bool isCapturedBy(const VarDecl &var, const Expr *e) { } else if (DeclStmt *DS = dyn_cast<DeclStmt>((*BI))) { // special case declarations - for (DeclStmt::decl_iterator I = DS->decl_begin(), E = DS->decl_end(); - I != E; ++I) { - if (VarDecl *VD = dyn_cast<VarDecl>((*I))) { - Expr *Init = VD->getInit(); + for (const auto *I : DS->decls()) { + if (const auto *VD = dyn_cast<VarDecl>((I))) { + const Expr *Init = VD->getInit(); if (Init && isCapturedBy(var, Init)) return true; } |
