pub struct CFG<B> {
pub root: NodeIndex,
pub graph: Graph<Block<B>, Edge, Directed>,
}Fields§
§root: NodeIndex§graph: Graph<Block<B>, Edge, Directed>Implementations§
Source§impl<B: BV> CFG<B>
impl<B: BV> CFG<B>
Sourcepub fn new(instrs: &[LabeledInstr<B>]) -> Self
pub fn new(instrs: &[LabeledInstr<B>]) -> Self
Construct a control flow graph from a slice of labeled instructions. Note that the set of labels should be pruned with super::prune_labels, otherwise the control flow graph will end up containing redundant blocks.
Sourcepub fn all_vars_typed(&self, ret_ty: &Ty<Name>) -> HashMap<Name, Ty<Name>>
pub fn all_vars_typed(&self, ret_ty: &Ty<Name>) -> HashMap<Name, Ty<Name>>
Returns a HashMap of all variables declared in a CFG. Also includes the special RETURN variable which is used to signal the return value of a function, hence why the return type of the function is also passed as an argument.
Auto Trait Implementations§
impl<B> Freeze for CFG<B>
impl<B> RefUnwindSafe for CFG<B>
impl<B> Send for CFG<B>
impl<B> Sync for CFG<B>
impl<B> Unpin for CFG<B>
impl<B> UnwindSafe for CFG<B>
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