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/AST/StmtProfile.cpp | |
parent | 9c218592c8400f1ad2345b39e64904fda067553d (diff) | |
download | bcm5719-llvm-642f173ae90097f0da877423172fe45a320e1e5f.tar.gz bcm5719-llvm-642f173ae90097f0da877423172fe45a320e1e5f.zip |
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/AST/StmtProfile.cpp')
-rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 63f432ca4c3..da996920c42 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -69,9 +69,9 @@ namespace { void StmtProfiler::VisitStmt(const Stmt *S) { ID.AddInteger(S->getStmtClass()); - for (Stmt::const_child_range C = S->children(); C; ++C) { - if (*C) - Visit(*C); + for (const Stmt *SubStmt : S->children()) { + if (SubStmt) + Visit(SubStmt); else ID.AddInteger(0); } |