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