Move is_cfg_cyclic from Body to BasicBlocks

This commit is contained in:
Tomasz Miąsko 2022-07-05 00:00:00 +00:00
parent c9dd1d9983
commit 2446b17745
2 changed files with 1 additions and 7 deletions

View File

@ -343,12 +343,6 @@ impl<'tcx> Body<'tcx> {
self.basic_blocks.as_mut() 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] #[inline]
pub fn local_kind(&self, local: Local) -> LocalKind { pub fn local_kind(&self, local: Local) -> LocalKind {
let index = local.as_usize(); let index = local.as_usize();

View File

@ -101,7 +101,7 @@ where
// transfer function for each block exactly once (assuming that we process blocks in RPO). // 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. // 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); return Self::new(tcx, body, analysis, None);
} }