summaryrefslogtreecommitdiff
path: root/compiler/optimizing/select_generator.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-10-25 16:54:12 +0100
committer Vladimir Marko <vmarko@google.com> 2016-10-27 14:30:29 +0100
commit2c45bc9137c29f886e69923535aff31a74d90829 (patch)
tree90c7762c2dcb1105bf5907d6a1d068f172ea6155 /compiler/optimizing/select_generator.cc
parent168c58ce18b139d313cbc6131e3bb43539952c55 (diff)
Remove H[Reverse]PostOrderIterator and HInsertionOrderIterator.
Use range-based loops instead, introducing helper functions ReverseRange() for iteration in reverse order in containers. When the contents of the underlying container change inside the loop, use an index-based loop that better exposes the container data modifications, compared to the old iterator interface that's hiding it which may lead to subtle bugs. Test: m test-art-host Change-Id: I2a4e6c508b854c37a697fc4b1e8423a8c92c5ea0
Diffstat (limited to 'compiler/optimizing/select_generator.cc')
-rw-r--r--compiler/optimizing/select_generator.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/optimizing/select_generator.cc b/compiler/optimizing/select_generator.cc
index e409035d9d..46d0d0eb65 100644
--- a/compiler/optimizing/select_generator.cc
+++ b/compiler/optimizing/select_generator.cc
@@ -76,8 +76,7 @@ void HSelectGenerator::Run() {
// Iterate in post order in the unlikely case that removing one occurrence of
// the selection pattern empties a branch block of another occurrence.
// Otherwise the order does not matter.
- for (HPostOrderIterator it(*graph_); !it.Done(); it.Advance()) {
- HBasicBlock* block = it.Current();
+ for (HBasicBlock* block : graph_->GetPostOrder()) {
if (!block->EndsWithIf()) continue;
// Find elements of the diamond pattern.