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

Method with_function

cranelift/codegen/src/dominator_tree/simple.rs:208–218  ·  view source on GitHub ↗

Allocate and compute a dominator tree.

(func: &Function, cfg: &ControlFlowGraph)

Source from the content-addressed store, hash-verified

206
207 /// Allocate and compute a dominator tree.
208 pub fn with_function(func: &Function, cfg: &ControlFlowGraph) -> Self {
209 let block_capacity = func.layout.block_capacity();
210 let mut domtree = Self {
211 nodes: SecondaryMap::with_capacity(block_capacity),
212 postorder: Vec::with_capacity(block_capacity),
213 dfs: Dfs::new(),
214 valid: false,
215 };
216 domtree.compute(func, cfg);
217 domtree
218 }
219
220 /// Reset and compute a CFG post-order and dominator tree.
221 pub fn compute(&mut self, func: &Function, cfg: &ControlFlowGraph) {

Callers

nothing calls this directly

Calls 3

block_capacityMethod · 0.80
newFunction · 0.50
computeMethod · 0.45

Tested by

no test coverage detected