From 642f173ae90097f0da877423172fe45a320e1e5f Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 2 Jul 2015 21:03:14 +0000 Subject: Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- clang/lib/CodeGen/CodeGenPGO.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenPGO.cpp') diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index f182a469b3a..8dffefc871f 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -275,10 +275,9 @@ struct ComputeRegionCounts : public ConstStmtVisitor { void VisitStmt(const Stmt *S) { RecordStmtCount(S); - for (Stmt::const_child_range I = S->children(); I; ++I) { - if (*I) - this->Visit(*I); - } + for (const Stmt *Child : S->children()) + if (Child) + this->Visit(Child); } void VisitFunctionDecl(const FunctionDecl *D) { -- cgit v1.2.3