]> git.lizzy.rs Git - rust.git/commitdiff
Move `is_cfg_cyclic` from Body to BasicBlocks
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Tue, 5 Jul 2022 00:00:00 +0000 (00:00 +0000)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Thu, 7 Jul 2022 06:11:49 +0000 (08:11 +0200)
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_mir_dataflow/src/framework/engine.rs

index 6a0aa247a94e5155de8991d13d01d9d0bac952b5..cfe8b0bddecff3a8bbfd18c9eb1989e41de7b4ec 100644 (file)
@@ -343,12 +343,6 @@ pub fn basic_blocks_mut(&mut self) -> &mut IndexVec<BasicBlock, BasicBlockData<'
         self.basic_blocks.as_mut()
     }
 
-    /// Returns `true` if a cycle exists in the control-flow graph that is reachable from the
-    /// `START_BLOCK`.
-    pub fn is_cfg_cyclic(&self) -> bool {
-        self.basic_blocks.is_cfg_cyclic()
-    }
-
     #[inline]
     pub fn local_kind(&self, local: Local) -> LocalKind {
         let index = local.as_usize();
index 20e14a77c1e57b466705df31910a77a1c8faf29b..180376d648a1cf0b501ef17b5206982ecbec488a 100644 (file)
@@ -101,7 +101,7 @@ pub fn new_gen_kill(tcx: TyCtxt<'tcx>, body: &'a mir::Body<'tcx>, analysis: A) -
         // transfer function for each block exactly once (assuming that we process blocks in RPO).
         //
         // In this case, there's no need to compute the block transfer functions ahead of time.
-        if !body.is_cfg_cyclic() {
+        if !body.basic_blocks.is_cfg_cyclic() {
             return Self::new(tcx, body, analysis, None);
         }