Revert spurious changes.
This commit is contained in:
parent
8c2c695c9e
commit
7c8f29f02c
2 changed files with 11 additions and 11 deletions
|
@ -155,7 +155,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||||
if self.unwind_edge_count <= 1 {
|
if self.unwind_edge_count <= 1 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let dom_tree = self.body.basic_blocks.dominators();
|
let doms = self.body.basic_blocks.dominators();
|
||||||
let mut post_contract_node = FxHashMap::default();
|
let mut post_contract_node = FxHashMap::default();
|
||||||
// Reusing the allocation across invocations of the closure
|
// Reusing the allocation across invocations of the closure
|
||||||
let mut dom_path = vec![];
|
let mut dom_path = vec![];
|
||||||
|
@ -164,7 +164,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||||
if let Some(root) = post_contract_node.get(&bb) {
|
if let Some(root) = post_contract_node.get(&bb) {
|
||||||
break *root;
|
break *root;
|
||||||
}
|
}
|
||||||
let parent = dom_tree.immediate_dominator(bb).unwrap();
|
let parent = doms.immediate_dominator(bb).unwrap();
|
||||||
dom_path.push(bb);
|
dom_path.push(bb);
|
||||||
if !self.body.basic_blocks[parent].is_cleanup {
|
if !self.body.basic_blocks[parent].is_cleanup {
|
||||||
break bb;
|
break bb;
|
||||||
|
|
|
@ -6,8 +6,8 @@ use super::super::tests::TestGraph;
|
||||||
fn diamond() {
|
fn diamond() {
|
||||||
let graph = TestGraph::new(0, &[(0, 1), (0, 2), (1, 3), (2, 3)]);
|
let graph = TestGraph::new(0, &[(0, 1), (0, 2), (1, 3), (2, 3)]);
|
||||||
|
|
||||||
let tree = dominators(&graph);
|
let dominators = dominators(&graph);
|
||||||
let immediate_dominators = &tree.immediate_dominators;
|
let immediate_dominators = &dominators.immediate_dominators;
|
||||||
assert_eq!(immediate_dominators[0], None);
|
assert_eq!(immediate_dominators[0], None);
|
||||||
assert_eq!(immediate_dominators[1], Some(0));
|
assert_eq!(immediate_dominators[1], Some(0));
|
||||||
assert_eq!(immediate_dominators[2], Some(0));
|
assert_eq!(immediate_dominators[2], Some(0));
|
||||||
|
@ -22,8 +22,8 @@ fn paper() {
|
||||||
&[(6, 5), (6, 4), (5, 1), (4, 2), (4, 3), (1, 2), (2, 3), (3, 2), (2, 1)],
|
&[(6, 5), (6, 4), (5, 1), (4, 2), (4, 3), (1, 2), (2, 3), (3, 2), (2, 1)],
|
||||||
);
|
);
|
||||||
|
|
||||||
let dom_tree = dominators(&graph);
|
let dominators = dominators(&graph);
|
||||||
let immediate_dominators = &dom_tree.immediate_dominators;
|
let immediate_dominators = &dominators.immediate_dominators;
|
||||||
assert_eq!(immediate_dominators[0], None); // <-- note that 0 is not in graph
|
assert_eq!(immediate_dominators[0], None); // <-- note that 0 is not in graph
|
||||||
assert_eq!(immediate_dominators[1], Some(6));
|
assert_eq!(immediate_dominators[1], Some(6));
|
||||||
assert_eq!(immediate_dominators[2], Some(6));
|
assert_eq!(immediate_dominators[2], Some(6));
|
||||||
|
@ -47,9 +47,9 @@ fn paper_slt() {
|
||||||
#[test]
|
#[test]
|
||||||
fn immediate_dominator() {
|
fn immediate_dominator() {
|
||||||
let graph = TestGraph::new(1, &[(1, 2), (2, 3)]);
|
let graph = TestGraph::new(1, &[(1, 2), (2, 3)]);
|
||||||
let tree = dominators(&graph);
|
let dominators = dominators(&graph);
|
||||||
assert_eq!(tree.immediate_dominator(0), None);
|
assert_eq!(dominators.immediate_dominator(0), None);
|
||||||
assert_eq!(tree.immediate_dominator(1), None);
|
assert_eq!(dominators.immediate_dominator(1), None);
|
||||||
assert_eq!(tree.immediate_dominator(2), Some(1));
|
assert_eq!(dominators.immediate_dominator(2), Some(1));
|
||||||
assert_eq!(tree.immediate_dominator(3), Some(2));
|
assert_eq!(dominators.immediate_dominator(3), Some(2));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue