about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/transform
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2023-01-21 00:00:00 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-05-17 09:36:12 +0000
commitaa1267f630e01d19dcd9247ffb3a795aba0df461 (patch)
tree728c396cd52dd432451924923edf2210be8a52f0 /compiler/rustc_const_eval/src/transform
parent6c64870fa67f0227f40f6adc25a6944e95c2959f (diff)
downloadrust-aa1267f630e01d19dcd9247ffb3a795aba0df461.tar.gz
rust-aa1267f630e01d19dcd9247ffb3a795aba0df461.zip
Preprocess dominator tree to answer queries in O(1)
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
-rw-r--r--compiler/rustc_const_eval/src/transform/validate.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs
index 3c350e25ba6..2d8cbea8bac 100644
--- a/compiler/rustc_const_eval/src/transform/validate.rs
+++ b/compiler/rustc_const_eval/src/transform/validate.rs
@@ -155,7 +155,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
         if self.unwind_edge_count <= 1 {
             return;
         }
-        let doms = self.body.basic_blocks.dominators();
+        let dom_tree = self.body.basic_blocks.dominator_tree();
         let mut post_contract_node = FxHashMap::default();
         // Reusing the allocation across invocations of the closure
         let mut dom_path = vec![];
@@ -164,7 +164,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
                 if let Some(root) = post_contract_node.get(&bb) {
                     break *root;
                 }
-                let parent = doms.immediate_dominator(bb).unwrap();
+                let parent = dom_tree.immediate_dominator(bb).unwrap();
                 dom_path.push(bb);
                 if !self.body.basic_blocks[parent].is_cleanup {
                     break bb;