aboutsummaryrefslogtreecommitdiff
path: root/clang/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
commitc7e4e219b500d84eb5032afb0d0fde5db335d1e8 (patch)
tree5063b67f2bcd5fb782384842a9c2576cb676f189 /clang/lib/CodeGen/CGDecl.cpp
parenta0eb97a50b40ac96cd79298a0fd132fd267339fb (diff)
downloadllvm-c7e4e219b500d84eb5032afb0d0fde5db335d1e8.zip
llvm-c7e4e219b500d84eb5032afb0d0fde5db335d1e8.tar.gz
llvm-c7e4e219b500d84eb5032afb0d0fde5db335d1e8.tar.bz2
[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.
llvm-svn: 204040
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index cf1c366..e16845c 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/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))) {