Implement IntoIterator for PrimaryMap.

This makes iterating through a `PrimaryMap` more consistent with
iterating through a `Vec`.
This commit is contained in:
Dan Gohman
2018-06-07 15:32:11 -07:00
parent fdf89edbfe
commit 00d7d3a774
4 changed files with 32 additions and 8 deletions

View File

@@ -44,7 +44,7 @@ pub fn do_dce(func: &mut Function, domtree: &mut DominatorTree) {
let mut live = Vec::with_capacity(func.dfg.num_values());
live.resize(func.dfg.num_values(), false);
for &ebb in domtree.cfg_postorder().iter() {
for &ebb in domtree.cfg_postorder() {
let mut pos = FuncCursor::new(func).at_bottom(ebb);
while let Some(inst) = pos.prev_inst() {
{