From c7e4e219b500d84eb5032afb0d0fde5db335d1e8 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 17 Mar 2014 14:19:37 +0000 Subject: [C++11] Replacing CompoundStmt iterators body_begin() and body_end() with iterator_range body(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204040 --- clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp') diff --git a/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp b/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp index ccf0a91dab0..31f19cebea4 100644 --- a/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp +++ b/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp @@ -89,9 +89,8 @@ public: bool VisitCompoundStmt(CompoundStmt *S) { if (S->body_empty()) return false; // was already empty, not because of transformations. - for (CompoundStmt::body_iterator - I = S->body_begin(), E = S->body_end(); I != E; ++I) - if (!Visit(*I)) + for (auto *I : S->body()) + if (!Visit(I)) return false; return true; } @@ -167,9 +166,8 @@ public: } bool VisitCompoundStmt(CompoundStmt *S) { - for (CompoundStmt::body_iterator - I = S->body_begin(), E = S->body_end(); I != E; ++I) - check(*I); + for (auto *I : S->body()) + check(I); return true; } @@ -189,9 +187,8 @@ private: static bool isBodyEmpty(CompoundStmt *body, ASTContext &Ctx, std::vector &MacroLocs) { - for (CompoundStmt::body_iterator - I = body->body_begin(), E = body->body_end(); I != E; ++I) - if (!EmptyChecker(Ctx, MacroLocs).Visit(*I)) + for (auto *I : body->body()) + if (!EmptyChecker(Ctx, MacroLocs).Visit(I)) return false; return true; -- cgit v1.2.3