Add convenience function for detecting cyclic CFGs

This commit is contained in:
Dylan MacKenzie 2019-09-18 14:53:55 -07:00
parent 4fd9b9944f
commit c9e4816fe3

View File

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