summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFG.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-07-02 21:03:14 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-07-02 21:03:14 +0000
commit642f173ae90097f0da877423172fe45a320e1e5f (patch)
tree284e9818d8cc8d4cf9782398cd4b3573104ff746 /clang/lib/Analysis/CFG.cpp
parent9c218592c8400f1ad2345b39e64904fda067553d (diff)
downloadbcm5719-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/Analysis/CFG.cpp')
-rw-r--r--clang/lib/Analysis/CFG.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 19b3f5a4765..54d15bd232a 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -270,9 +270,8 @@ reverse_children::reverse_children(Stmt *S) {
}
// Default case for all other statements.
- for (Stmt::child_range I = S->children(); I; ++I) {
- childrenBuf.push_back(*I);
- }
+ for (Stmt *SubStmt : S->children())
+ childrenBuf.push_back(SubStmt);
// This needs to be done *after* childrenBuf has been populated.
children = childrenBuf;
@@ -3641,11 +3640,11 @@ CFGBlock *CFGBuilder::VisitChildrenForTemporaryDtors(Stmt *E,
// bottom-up, this means we visit them in their natural order, which
// reverses them in the CFG.
CFGBlock *B = Block;
- for (Stmt::child_range I = E->children(); I; ++I) {
- if (Stmt *Child = *I)
+ for (Stmt *Child : E->children())
+ if (Child)
if (CFGBlock *R = VisitForTemporaryDtors(Child, false, Context))
B = R;
- }
+
return B;
}
OpenPOWER on IntegriCloud