diff options
| author | Edd Barrett <vext01@gmail.com> | 2019-04-09 11:48:31 +0100 |
|---|---|---|
| committer | Edd Barrett <vext01@gmail.com> | 2019-04-09 11:48:31 +0100 |
| commit | 3262d1e25242a6dc0c486e78be8b03b71a9106b7 (patch) | |
| tree | 5d3e61227173331ffbd9083f281c3b4acd15dd85 /src/librustc_data_structures | |
| parent | 3750348daff89741e3153e0e120aa70a45ff5b68 (diff) | |
| download | rust-3262d1e25242a6dc0c486e78be8b03b71a9106b7.tar.gz rust-3262d1e25242a6dc0c486e78be8b03b71a9106b7.zip | |
Kill dead code dominator code.
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/graph/dominators/mod.rs | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/librustc_data_structures/graph/dominators/mod.rs b/src/librustc_data_structures/graph/dominators/mod.rs index aaed41d9fa3..93a2a261c6f 100644 --- a/src/librustc_data_structures/graph/dominators/mod.rs +++ b/src/librustc_data_structures/graph/dominators/mod.rs @@ -8,8 +8,6 @@ use super::super::indexed_vec::{Idx, IndexVec}; use super::iterate::reverse_post_order; use super::ControlFlowGraph; -use std::fmt; - #[cfg(test)] mod test; @@ -158,48 +156,3 @@ impl<'dom, Node: Idx> Iterator for Iter<'dom, Node> { } } } - -pub struct DominatorTree<N: Idx> { - root: N, - children: IndexVec<N, Vec<N>>, -} - -impl<Node: Idx> DominatorTree<Node> { - pub fn children(&self, node: Node) -> &[Node] { - &self.children[node] - } -} - -impl<Node: Idx> fmt::Debug for DominatorTree<Node> { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Debug::fmt( - &DominatorTreeNode { - tree: self, - node: self.root, - }, - fmt, - ) - } -} - -struct DominatorTreeNode<'tree, Node: Idx> { - tree: &'tree DominatorTree<Node>, - node: Node, -} - -impl<'tree, Node: Idx> fmt::Debug for DominatorTreeNode<'tree, Node> { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - let subtrees: Vec<_> = self.tree - .children(self.node) - .iter() - .map(|&child| DominatorTreeNode { - tree: self.tree, - node: child, - }) - .collect(); - fmt.debug_tuple("") - .field(&self.node) - .field(&subtrees) - .finish() - } -} |
