MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / next_inst_ret_prev

Function next_inst_ret_prev

cranelift/src/bugpoint.rs:760–776  ·  view source on GitHub ↗
(
    func: &Function,
    block: &mut Block,
    inst: &mut Inst,
)

Source from the content-addressed store, hash-verified

758}
759
760fn 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
778fn block_count(func: &Function) -> usize {
779 func.layout.blocks().count()

Callers 1

mutateMethod · 0.85

Calls 4

first_instMethod · 0.80
next_instMethod · 0.45
next_blockMethod · 0.45
expectMethod · 0.45

Tested by

no test coverage detected