]> git.lizzy.rs Git - rust.git/commitdiff
Kill dead code dominator code.
authorEdd Barrett <vext01@gmail.com>
Tue, 9 Apr 2019 10:48:31 +0000 (11:48 +0100)
committerEdd Barrett <vext01@gmail.com>
Tue, 9 Apr 2019 10:48:31 +0000 (11:48 +0100)
src/librustc_data_structures/graph/dominators/mod.rs

index aaed41d9fa3620e15fb2ebe14ee1462cdbb188e6..93a2a261c6fdeeaa49061d0064a0000e45eb945c 100644 (file)
@@ -8,8 +8,6 @@
 use super::iterate::reverse_post_order;
 use super::ControlFlowGraph;
 
-use std::fmt;
-
 #[cfg(test)]
 mod test;
 
@@ -158,48 +156,3 @@ fn next(&mut self) -> Option<Self::Item> {
         }
     }
 }
-
-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()
-    }
-}