diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-17 14:19:37 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-17 14:19:37 +0000 |
| commit | bcbb92d12f871a8f927c7f1cfcb45fbd859c8369 (patch) | |
| tree | 3e026e0ebcfa5528b218f4e9561519ec4bf019d7 /lib/CodeGen/CGDecl.cpp | |
| parent | e5e230f916a8afa17cc1c03c91cafbff01cbc604 (diff) | |
| download | clang-bcbb92d12f871a8f927c7f1cfcb45fbd859c8369.tar.gz clang-bcbb92d12f871a8f927c7f1cfcb45fbd859c8369.tar.bz2 clang-bcbb92d12f871a8f927c7f1cfcb45fbd859c8369.tar.xz | |
[C++11] Replacing CompoundStmt iterators body_begin() and body_end() with iterator_range body(). Updating all of the usages of the iterators with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204040 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 cf1c36675e..e16845c680 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -1003,13 +1003,12 @@ static bool isCapturedBy(const VarDecl &var, const Expr *e) { if (const StmtExpr *SE = dyn_cast<StmtExpr>(e)) { const CompoundStmt *CS = SE->getSubStmt(); - for (CompoundStmt::const_body_iterator BI = CS->body_begin(), - BE = CS->body_end(); BI != BE; ++BI) - if (Expr *E = dyn_cast<Expr>((*BI))) { + for (const auto *BI : CS->body()) + if (const auto *E = dyn_cast<Expr>(BI)) { if (isCapturedBy(var, E)) return true; } - else if (DeclStmt *DS = dyn_cast<DeclStmt>((*BI))) { + else if (const auto *DS = dyn_cast<DeclStmt>(BI)) { // special case declarations for (const auto *I : DS->decls()) { if (const auto *VD = dyn_cast<VarDecl>((I))) { |
