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

Method remove_block_predecessor

cranelift/frontend/src/ssa.rs:417–427  ·  view source on GitHub ↗

Remove a previously declared Block predecessor by giving a reference to the jump instruction. Returns the basic block containing the instruction. Note: use only when you know what you are doing, this might break the SSA building problem

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

Source from the content-addressed store, hash-verified

415 ///
416 /// Note: use only when you know what you are doing, this might break the SSA building problem
417 pub fn remove_block_predecessor(&mut self, block: Block, inst: Inst) {
418 debug_assert!(!self.is_sealed(block));
419 let data = &mut self.ssa_blocks[block];
420 let pred = data
421 .predecessors
422 .as_slice(&self.inst_pool)
423 .iter()
424 .position(|&branch| branch == inst)
425 .expect("the predecessor you are trying to remove is not declared");
426 data.predecessors.swap_remove(pred, &mut self.inst_pool);
427 }
428
429 /// Completes the global value numbering for a `Block`, all of its predecessors having been
430 /// already sealed.

Callers 1

Calls 5

expectMethod · 0.45
positionMethod · 0.45
iterMethod · 0.45
as_sliceMethod · 0.45
swap_removeMethod · 0.45

Tested by

no test coverage detected