summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-17 14:19:37 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-17 14:19:37 +0000
commitbcbb92d12f871a8f927c7f1cfcb45fbd859c8369 (patch)
tree3e026e0ebcfa5528b218f4e9561519ec4bf019d7 /lib/CodeGen/CGDecl.cpp
parente5e230f916a8afa17cc1c03c91cafbff01cbc604 (diff)
downloadclang-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.cpp7
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))) {