diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-07-02 21:03:14 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-07-02 21:03:14 +0000 |
commit | 642f173ae90097f0da877423172fe45a320e1e5f (patch) | |
tree | 284e9818d8cc8d4cf9782398cd4b3573104ff746 /clang/lib/CodeGen/CGDecl.cpp | |
parent | 9c218592c8400f1ad2345b39e64904fda067553d (diff) | |
download | llvm-642f173ae90097f0da877423172fe45a320e1e5f.zip llvm-642f173ae90097f0da877423172fe45a320e1e5f.tar.gz llvm-642f173ae90097f0da877423172fe45a320e1e5f.tar.bz2 |
Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops.
The pattern was born out of the lack of range-based for loops in C++98
and is somewhat obscure. No functionality change intended.
llvm-svn: 241300
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 07dbce4..839c2e4 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -579,9 +579,9 @@ static bool isAccessedBy(const VarDecl &var, const Stmt *s) { } } - for (Stmt::const_child_range children = s->children(); children; ++children) - // children might be null; as in missing decl or conditional of an if-stmt. - if ((*children) && isAccessedBy(var, *children)) + for (const Stmt *SubStmt : s->children()) + // SubStmt might be null; as in missing decl or conditional of an if-stmt. + if (SubStmt && isAccessedBy(var, SubStmt)) return true; return false; @@ -1074,8 +1074,8 @@ static bool isCapturedBy(const VarDecl &var, const Expr *e) { return false; } - for (Stmt::const_child_range children = e->children(); children; ++children) - if (isCapturedBy(var, cast<Expr>(*children))) + for (const Stmt *SubStmt : e->children()) + if (isCapturedBy(var, cast<Expr>(SubStmt))) return true; return false; |