mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Add convenience function for detecting cyclic CFGs
This commit is contained in:
parent
4fd9b9944f
commit
c9e4816fe3
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user