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

Method insert_block_after

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

Insert `block` in the layout *after* the existing block `after`.

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

Source from the content-addressed store, hash-verified

267
268 /// Insert `block` in the layout *after* the existing block `after`.
269 pub fn insert_block_after(&mut self, block: Block, after: Block) {
270 debug_assert!(
271 !self.is_block_inserted(block),
272 "Cannot insert block that is already in the layout"
273 );
274 debug_assert!(
275 self.is_block_inserted(after),
276 "block Insertion point not in the layout"
277 );
278 let before = self.blocks[after].next;
279 {
280 let node = &mut self.blocks[block];
281 node.next = before;
282 node.prev = after.into();
283 }
284 self.blocks[after].next = block.into();
285 match before.expand() {
286 None => self.last_block = Some(block),
287 Some(b) => self.blocks[b].prev = block.into(),
288 }
289 }
290
291 /// Remove all instructions from `block` and then remove it from
292 /// the layout.

Callers 3

inline_block_layoutFunction · 0.45
insert_blockMethod · 0.45
insert_block_afterFunction · 0.45

Calls 1

expandMethod · 0.45

Tested by 1

insert_block_afterFunction · 0.36