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

Method append_inst

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

Append `inst` to the end of `block`.

(&mut self, inst: Inst, block: Block)

Source from the content-addressed store, hash-verified

427
428 /// Append `inst` to the end of `block`.
429 pub fn append_inst(&mut self, inst: Inst, block: Block) {
430 debug_assert_eq!(self.inst_block(inst), None);
431 debug_assert!(
432 self.is_block_inserted(block),
433 "Cannot append instructions to block not in layout"
434 );
435 {
436 let block_node = &mut self.blocks[block];
437 {
438 let inst_node = &mut self.insts[inst];
439 inst_node.block = block.into();
440 inst_node.prev = block_node.last_inst;
441 debug_assert!(inst_node.next.is_none());
442 }
443 if block_node.first_inst.is_none() {
444 block_node.first_inst = inst.into();
445 } else {
446 self.insts[block_node.last_inst.unwrap()].next = inst.into();
447 }
448 block_node.last_inst = inst.into();
449 }
450 self.assign_inst_seq(inst);
451 }
452
453 /// Fetch a block's first instruction.
454 pub fn first_inst(&self, block: Block) -> Option<Inst> {

Callers 13

buildMethod · 0.80
parse_instructionMethod · 0.80
mutateMethod · 0.80
inline_oneFunction · 0.80
insert_instMethod · 0.80
visit_seqMethod · 0.80
append_instFunction · 0.80
insert_instFunction · 0.80
multiple_blocksFunction · 0.80
split_blockFunction · 0.80
bad_instruction_formatFunction · 0.80
test_iconst_boundsFunction · 0.80

Calls 3

assign_inst_seqMethod · 0.80
is_noneMethod · 0.45
unwrapMethod · 0.45

Tested by 7

append_instFunction · 0.64
insert_instFunction · 0.64
multiple_blocksFunction · 0.64
split_blockFunction · 0.64
bad_instruction_formatFunction · 0.64
test_iconst_boundsFunction · 0.64