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

Method invalidate_block_successors

cranelift/codegen/src/flowgraph.rs:125–136  ·  view source on GitHub ↗
(&mut self, block: Block)

Source from the content-addressed store, hash-verified

123 }
124
125 fn invalidate_block_successors(&mut self, block: Block) {
126 // Temporarily take ownership because we need mutable access to self.data inside the loop.
127 // Unfortunately borrowck cannot see that our mut accesses to predecessors don't alias
128 // our iteration over successors.
129 let mut successors = mem::replace(&mut self.data[block].successors, Default::default());
130 for succ in successors.iter(&self.succ_forest) {
131 self.data[succ]
132 .predecessors
133 .retain(&mut self.pred_forest, |_, &mut e| e != block);
134 }
135 successors.clear(&mut self.succ_forest);
136 }
137
138 /// Recompute the control flow graph of `block`.
139 ///

Callers 1

recompute_blockMethod · 0.80

Calls 4

replaceFunction · 0.50
iterMethod · 0.45
retainMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected