diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-17 14:19:37 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-17 14:19:37 +0000 |
commit | c7e4e219b500d84eb5032afb0d0fde5db335d1e8 (patch) | |
tree | 5063b67f2bcd5fb782384842a9c2576cb676f189 /clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp | |
parent | a0eb97a50b40ac96cd79298a0fd132fd267339fb (diff) | |
download | bcm5719-llvm-c7e4e219b500d84eb5032afb0d0fde5db335d1e8.tar.gz bcm5719-llvm-c7e4e219b500d84eb5032afb0d0fde5db335d1e8.zip |
[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
Diffstat (limited to 'clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp')
-rw-r--r-- | clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
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<SourceLocation> &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; |