summaryrefslogtreecommitdiff
path: root/compiler/optimizing/constant_folding.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/constant_folding.cc')
-rw-r--r--compiler/optimizing/constant_folding.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/optimizing/constant_folding.cc b/compiler/optimizing/constant_folding.cc
index b0a65ca64d..f57d8ade16 100644
--- a/compiler/optimizing/constant_folding.cc
+++ b/compiler/optimizing/constant_folding.cc
@@ -117,12 +117,9 @@ bool HConstantFolding::Run() {
void HConstantFoldingVisitor::VisitBasicBlock(HBasicBlock* block) {
- // Traverse this block's instructions (phis don't need to be
- // processed) in (forward) order and replace the ones that can be
- // statically evaluated by a compile-time counterpart.
- for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
- it.Current()->Accept(this);
- }
+ // Traverse this block's instructions (phis don't need to be processed) in (forward) order
+ // and replace the ones that can be statically evaluated by a compile-time counterpart.
+ VisitNonPhiInstructions(block);
}
void HConstantFoldingVisitor::VisitUnaryOperation(HUnaryOperation* inst) {