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

Method rewrite_branch_destination

cranelift/codegen/src/ir/function.rs:297–305  ·  view source on GitHub ↗

Rewrite the branch destination to `new_dest` if the destination matches `old_dest`. Does nothing if called with a non-jump or non-branch instruction.

(&mut self, inst: Inst, old_dest: Block, new_dest: Block)

Source from the content-addressed store, hash-verified

295 /// Rewrite the branch destination to `new_dest` if the destination matches `old_dest`.
296 /// Does nothing if called with a non-jump or non-branch instruction.
297 pub fn rewrite_branch_destination(&mut self, inst: Inst, old_dest: Block, new_dest: Block) {
298 for dest in self.dfg.insts[inst]
299 .branch_destination_mut(&mut self.dfg.jump_tables, &mut self.dfg.exception_tables)
300 {
301 if dest.block(&self.dfg.value_lists) == old_dest {
302 dest.set_block(new_dest, &mut self.dfg.value_lists)
303 }
304 }
305 }
306
307 /// Checks that the specified block can be encoded as a basic block.
308 ///

Callers

nothing calls this directly

Calls 3

set_blockMethod · 0.80
blockMethod · 0.45

Tested by

no test coverage detected