Allocate and compute a dominator tree.
(func: &Function, cfg: &ControlFlowGraph)
| 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: |
nothing calls this directly
no test coverage detected