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

Method with_function

cranelift/codegen/src/dominator_tree.rs:328–340  ·  view source on GitHub ↗

Allocate and compute a dominator tree.

(func: &Function, cfg: &ControlFlowGraph)

Source from the content-addressed store, hash-verified

326
327 /// Allocate and compute a dominator tree.
328 pub fn with_function(func: &Function, cfg: &ControlFlowGraph) -> Self {
329 let block_capacity = func.layout.block_capacity();
330 let mut domtree = Self {
331 stree: SpanningTree::with_capacity(block_capacity),
332 nodes: SecondaryMap::with_capacity(block_capacity),
333 postorder: Vec::with_capacity(block_capacity),
334 dfs_worklist: Vec::new(),
335 eval_worklist: Vec::new(),
336 valid: false,
337 };
338 domtree.compute(func, cfg);
339 domtree
340 }
341
342 /// Reset and compute a CFG post-order and dominator tree,
343 /// using Semi-NCA algorithm, described in the paper:

Callers

nothing calls this directly

Calls 3

block_capacityMethod · 0.80
newFunction · 0.50
computeMethod · 0.45

Tested by

no test coverage detected