pub struct ControlDependence { /* private fields */ }Expand description
Which branches decide whether a block runs.
This is the post-dominance frontier under the name a pass would look for. A block is control dependent on a branch when one arm of the branch always reaches it and the other does not have to, so the branch is what a pass has to keep in order to keep the block meaningful.
Implementations§
Source§impl ControlDependence
impl ControlDependence
Sourcepub fn new(cfg: &Cfg, post: &PostDominators) -> Self
pub fn new(cfg: &Cfg, post: &PostDominators) -> Self
Builds the relation for every block.
Sourcepub fn on(&self, block: Block) -> &[Block] ⓘ
pub fn on(&self, block: Block) -> &[Block] ⓘ
The blocks whose terminator decides whether this one runs.
Empty for a block that runs whenever the function runs, which is the entry and every block that post-dominates it.
Sourcepub fn unconditional(&self, block: Block) -> bool
pub fn unconditional(&self, block: Block) -> bool
Whether this block runs whatever any branch decides.
Trait Implementations§
Source§impl Clone for ControlDependence
impl Clone for ControlDependence
Source§fn clone(&self) -> ControlDependence
fn clone(&self) -> ControlDependence
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ControlDependence
impl Debug for ControlDependence
Source§impl Default for ControlDependence
impl Default for ControlDependence
Source§fn default() -> ControlDependence
fn default() -> ControlDependence
Returns the “default value” for a type. Read more
impl Eq for ControlDependence
Source§impl PartialEq for ControlDependence
impl PartialEq for ControlDependence
impl StructuralPartialEq for ControlDependence
Auto Trait Implementations§
impl Freeze for ControlDependence
impl RefUnwindSafe for ControlDependence
impl Send for ControlDependence
impl Sync for ControlDependence
impl Unpin for ControlDependence
impl UnsafeUnpin for ControlDependence
impl UnwindSafe for ControlDependence
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more