Struct flowistry_pdg::rustc::mir::traversal::ReversePostorder
source · pub struct ReversePostorder<'a, 'tcx> {
body: &'a Body<'tcx>,
blocks: Vec<BasicBlock, Global>,
idx: usize,
}
Expand description
Reverse postorder traversal of a graph
Reverse postorder is the reverse order of a postorder traversal. This is different to a preorder traversal and represents a natural linearization of control-flow.
A
/ \
/ \
B C
\ /
\ /
D
A reverse postorder traversal of this graph is either A B C D
or A C B D
Note that for a graph containing no loops (i.e., A DAG), this is equivalent to
a topological sort.
Construction of a ReversePostorder
traversal requires doing a full
postorder traversal of the graph, therefore this traversal should be
constructed as few times as possible. Use the reset
method to be able
to re-use the traversal
Fields§
§body: &'a Body<'tcx>
§blocks: Vec<BasicBlock, Global>
§idx: usize
Auto Trait Implementations§
impl<'a, 'tcx> !RefUnwindSafe for ReversePostorder<'a, 'tcx>
impl<'a, 'tcx> !Send for ReversePostorder<'a, 'tcx>
impl<'a, 'tcx> !Sync for ReversePostorder<'a, 'tcx>
impl<'a, 'tcx> Unpin for ReversePostorder<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for ReversePostorder<'a, 'tcx>
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