pub struct PostDominators { /* private fields */ }Expand description
Which block every path to the exit has to pass through after leaving another.
Implementations§
Source§impl PostDominators
impl PostDominators
Sourcepub fn new(cfg: &Cfg) -> Self
pub fn new(cfg: &Cfg) -> Self
Builds the tree over the reversed graph.
§Panics
Panics if a block control reaches still has no path to the exit after the fake edges have been added, which would mean the answers below were arbitrary. Section 6.8 of the design asks for exactly this, on the grounds that a wrong answer here is worth turning into a crash.
Sourcepub fn post_dominates(&self, of: Block, block: Block) -> bool
pub fn post_dominates(&self, of: Block, block: Block) -> bool
Whether every path from block to the exit goes through of.
A block post-dominates itself. Both ends have to be blocks control reaches.
Sourcepub fn strictly_post_dominates(&self, of: Block, block: Block) -> bool
pub fn strictly_post_dominates(&self, of: Block, block: Block) -> bool
The same, without a block post-dominating itself.
Sourcepub fn immediate_post_dominator(&self, block: Block) -> Option<Block>
pub fn immediate_post_dominator(&self, block: Block) -> Option<Block>
The nearest block that post-dominates this one and is not it.
None when the next thing on every path out is the end of the function, and for a block
control does not reach.
Sourcepub fn fake_exits(&self) -> &[Block] ⓘ
pub fn fake_exits(&self) -> &[Block] ⓘ
The blocks an edge to the exit was invented for, because nothing led there from them.
A block is in here when it is the far end of an infinite loop. The list is public because a pass that reasons about paths should be able to tell that one of them was added by this analysis and is not a path the program can take.
Trait Implementations§
Source§impl Clone for PostDominators
impl Clone for PostDominators
Source§fn clone(&self) -> PostDominators
fn clone(&self) -> PostDominators
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more