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

Method insert_block

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

Insert `block` in the layout before the existing block `before`.

(&mut self, block: Block, before: Block)

Source from the content-addressed store, hash-verified

244
245 /// Insert `block` in the layout before the existing block `before`.
246 pub fn insert_block(&mut self, block: Block, before: Block) {
247 debug_assert!(
248 !self.is_block_inserted(block),
249 "Cannot insert block that is already in the layout"
250 );
251 debug_assert!(
252 self.is_block_inserted(before),
253 "block Insertion point not in the layout"
254 );
255 let after = self.blocks[before].prev;
256 {
257 let node = &mut self.blocks[block];
258 node.next = before.into();
259 node.prev = after;
260 }
261 self.blocks[before].prev = block.into();
262 match after.expand() {
263 None => self.first_block = Some(block),
264 Some(a) => self.blocks[a].next = block.into(),
265 }
266 }
267
268 /// Insert `block` in the layout *after* the existing block `after`.
269 pub fn insert_block_after(&mut self, block: Block, after: Block) {

Callers 15

simple_blockFunction · 0.45
sequence_of_blocksFunction · 0.45
program_with_loopFunction · 0.45
br_table_with_argsFunction · 0.45
undef_values_reorderingFunction · 0.45
unreachable_useFunction · 0.45
test_dfs_traversalFunction · 0.45
split_off_return_blockFunction · 0.45
aliasesFunction · 0.45

Calls 1

expandMethod · 0.45

Tested by 15

simple_blockFunction · 0.36
sequence_of_blocksFunction · 0.36
program_with_loopFunction · 0.36
br_table_with_argsFunction · 0.36
undef_values_reorderingFunction · 0.36
unreachable_useFunction · 0.36
test_dfs_traversalFunction · 0.36
aliasesFunction · 0.36
cold_blocksFunction · 0.36