Skip to content

Commit 3262d1e

Browse files
committed
Kill dead code dominator code.
1 parent 3750348 commit 3262d1e

File tree

1 file changed

+0
-47
lines changed
  • src/librustc_data_structures/graph/dominators

1 file changed

+0
-47
lines changed

src/librustc_data_structures/graph/dominators/mod.rs

-47
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ use super::super::indexed_vec::{Idx, IndexVec};
88
use super::iterate::reverse_post_order;
99
use super::ControlFlowGraph;
1010

11-
use std::fmt;
12-
1311
#[cfg(test)]
1412
mod test;
1513

@@ -158,48 +156,3 @@ impl<'dom, Node: Idx> Iterator for Iter<'dom, Node> {
158156
}
159157
}
160158
}
161-
162-
pub struct DominatorTree<N: Idx> {
163-
root: N,
164-
children: IndexVec<N, Vec<N>>,
165-
}
166-
167-
impl<Node: Idx> DominatorTree<Node> {
168-
pub fn children(&self, node: Node) -> &[Node] {
169-
&self.children[node]
170-
}
171-
}
172-
173-
impl<Node: Idx> fmt::Debug for DominatorTree<Node> {
174-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
175-
fmt::Debug::fmt(
176-
&DominatorTreeNode {
177-
tree: self,
178-
node: self.root,
179-
},
180-
fmt,
181-
)
182-
}
183-
}
184-
185-
struct DominatorTreeNode<'tree, Node: Idx> {
186-
tree: &'tree DominatorTree<Node>,
187-
node: Node,
188-
}
189-
190-
impl<'tree, Node: Idx> fmt::Debug for DominatorTreeNode<'tree, Node> {
191-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
192-
let subtrees: Vec<_> = self.tree
193-
.children(self.node)
194-
.iter()
195-
.map(|&child| DominatorTreeNode {
196-
tree: self.tree,
197-
node: child,
198-
})
199-
.collect();
200-
fmt.debug_tuple("")
201-
.field(&self.node)
202-
.field(&subtrees)
203-
.finish()
204-
}
205-
}

0 commit comments

Comments
 (0)