(
func: &Function,
block: &mut Block,
inst: &mut Inst,
)
| 758 | } |
| 759 | |
| 760 | fn next_inst_ret_prev( |
| 761 | func: &Function, |
| 762 | block: &mut Block, |
| 763 | inst: &mut Inst, |
| 764 | ) -> Option<(Block, Inst)> { |
| 765 | let prev = (*block, *inst); |
| 766 | if let Some(next_inst) = func.layout.next_inst(*inst) { |
| 767 | *inst = next_inst; |
| 768 | return Some(prev); |
| 769 | } |
| 770 | if let Some(next_block) = func.layout.next_block(*block) { |
| 771 | *block = next_block; |
| 772 | *inst = func.layout.first_inst(*block).expect("no inst"); |
| 773 | return Some(prev); |
| 774 | } |
| 775 | None |
| 776 | } |
| 777 | |
| 778 | fn block_count(func: &Function) -> usize { |
| 779 | func.layout.blocks().count() |
no test coverage detected