From c192b3dcffd5e672a2b2e1730e2440febb4fb192 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 5 Jul 2015 14:23:59 +0000 Subject: Vendor import of clang trunk r241361: https://llvm.org/svn/llvm-project/cfe/trunk@241361 --- lib/Analysis/CFG.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/Analysis/CFG.cpp') diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 19b3f5a47654..54d15bd232a1 100644 --- a/lib/Analysis/CFG.cpp +++ b/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; } -- cgit v1.3