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

Method remove_inst

cranelift/codegen/src/ir/layout.rs:495–517  ·  view source on GitHub ↗

Remove `inst` from the layout.

(&mut self, inst: Inst)

Source from the content-addressed store, hash-verified

493
494 /// Remove `inst` from the layout.
495 pub fn remove_inst(&mut self, inst: Inst) {
496 let block = self.inst_block(inst).expect("Instruction already removed.");
497 // Clear the `inst` node and extract links.
498 let prev;
499 let next;
500 {
501 let n = &mut self.insts[inst];
502 prev = n.prev;
503 next = n.next;
504 n.block = None.into();
505 n.prev = None.into();
506 n.next = None.into();
507 }
508 // Fix up links to `inst`.
509 match prev.expand() {
510 None => self.blocks[block].first_inst = next,
511 Some(p) => self.insts[p].next = next,
512 }
513 match next.expand() {
514 None => self.blocks[block].last_inst = prev,
515 Some(n) => self.insts[n].prev = prev,
516 }
517 }
518
519 /// Iterate over the instructions in `block` in layout order.
520 pub fn block_insts(&self, block: Block) -> Insts<'_> {

Callers 6

mutateMethod · 0.45
vmctx_addrFunction · 0.45
append_instFunction · 0.45
transplant_instMethod · 0.45

Calls 3

inst_blockMethod · 0.80
expectMethod · 0.45
expandMethod · 0.45

Tested by 1

append_instFunction · 0.36