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

Method replace_inst

cranelift/codegen/src/cursor.rs:573–577  ·  view source on GitHub ↗

Replace the instruction under the cursor with `new_inst`. The cursor is left pointing at the new instruction. The old instruction that was replaced is returned.

(&mut self, new_inst: ir::Inst)

Source from the content-addressed store, hash-verified

571 ///
572 /// The old instruction that was replaced is returned.
573 fn replace_inst(&mut self, new_inst: ir::Inst) -> ir::Inst {
574 let prev_inst = self.remove_inst();
575 self.insert_inst(new_inst);
576 prev_inst
577 }
578
579 /// Insert a block at the current position and switch to it.
580 ///

Implementers 2

cursor.rscranelift/codegen/src/cursor.rs
layout.rscranelift/codegen/src/ir/layout.rs

Calls 2

remove_instMethod · 0.45
insert_instMethod · 0.45

Tested by

no test coverage detected