pub struct DataflowGraph {
pub def_id: DefId,
pub span: Span,
pub argc: usize,
pub nodes: GraphNodes,
pub edges: GraphEdges,
pub n_locals: usize,
pub closures: HashSet<DefId>,
}Fields§
§def_id: DefId§span: Span§argc: usize§nodes: GraphNodes§edges: GraphEdges§n_locals: usize§closures: HashSet<DefId>Implementations§
Source§impl DataflowGraph
impl DataflowGraph
pub fn to_dot_graph<'tcx>(&self, tcx: &TyCtxt<'tcx>) -> String
Source§impl DataflowGraph
impl DataflowGraph
pub fn add_operand( &mut self, operand: &Operand<'_>, dst: Local, block: usize, stmt_idx: usize, )
pub fn parse_place( &mut self, place: &Place<'_>, block: usize, stmt_idx: usize, ) -> Local
pub fn add_statm_to_graph( &mut self, statement: &Statement<'_>, block: usize, stmt_idx: usize, )
pub fn add_terminator_to_graph( &mut self, terminator: &Terminator<'_>, block: usize, stmt_idx: usize, )
pub fn query_node_by_span( &self, span: Span, strict: bool, ) -> Option<(Local, &DataflowNode)>
Source§impl DataflowGraph
impl DataflowGraph
pub fn new(def_id: DefId, span: Span, argc: usize, n_locals: usize) -> Self
pub fn node(&self, local: Local) -> &DataflowNode
pub fn node_mut(&mut self, local: Local) -> &mut DataflowNode
pub fn edge(&self, idx: EdgeIdx) -> &DataflowEdge
pub fn is_marker(&self, idx: Local) -> bool
pub fn add_node_edge( &mut self, src: Local, dst: Local, op: EdgeOp, block: usize, statement_index: usize, ) -> EdgeIdx
pub fn add_const_edge( &mut self, src_desc: String, src_ty: String, dst: Local, op: EdgeOp, block: usize, statement_index: usize, ) -> EdgeIdx
pub fn get_upside_idx(&self, node_idx: Local, order: usize) -> Option<Local>
pub fn get_downside_idx(&self, node_idx: Local, order: usize) -> Option<Local>
pub fn is_connected(&self, idx_1: Local, idx_2: Local) -> bool
pub fn param_return_deps(&self) -> IndexVec<Local, bool>
pub fn dfs<F, G>( &self, now: Local, direction: Direction, node_operator: &mut F, edge_validator: &mut G, traverse_all: bool, seen: &mut HashSet<Local>, ) -> (DFSStatus, bool)
pub fn find_first_node<P, E>( &self, start: Local, direction: Direction, node_predicate: &mut P, edge_validator: &mut E, ) -> Option<Local>
pub fn find_all_nodes<P, E>( &self, start: Local, direction: Direction, node_predicate: &mut P, edge_validator: &mut E, ) -> Vec<Local>
pub fn equivalent_edge_validator( graph: &DataflowGraph, idx: EdgeIdx, ) -> DFSStatus
pub fn always_true_edge_validator(_: &DataflowGraph, _: EdgeIdx) -> DFSStatus
pub fn collect_equivalent_locals( &self, local: Local, strict: bool, ) -> HashSet<Local>
fn collect_by_direction( &self, local: Local, self_included: bool, direction: Direction, ) -> HashSet<Local>
pub fn collect_ancestor_locals( &self, local: Local, self_included: bool, ) -> HashSet<Local>
pub fn collect_descending_locals( &self, local: Local, self_included: bool, ) -> HashSet<Local>
pub fn get_field_sequence(&self, local: Local) -> Option<(Local, Vec<usize>)>
Sourcepub fn trace_origin(&self, local: Local) -> Local
pub fn trace_origin(&self, local: Local) -> Local
Follow Copy/Move edges upward to find the root real local behind any copy chains (no projections). Stops at 16 hops to bound cycles.
Sourcepub fn is_from_tuple_field(&self, local: Local) -> bool
pub fn is_from_tuple_field(&self, local: Local) -> bool
Return true when local originates from a tuple field destructuring
(e.g. (tuple.0, tuple.1) after a call returning a tuple).
Follows Copy/Move chains upward through marker nodes and checks for
any Field edge along the projection chain.
Sourcefn marker_to_real(&self, marker: Local) -> Option<Local>
fn marker_to_real(&self, marker: Local) -> Option<Local>
Walk up a projection-marker chain to find the underlying real local.
Sourcefn marker_chain_has_field(&self, marker: Local) -> bool
fn marker_chain_has_field(&self, marker: Local) -> bool
Check whether a projection-marker chain contains a Field edge.
Trait Implementations§
Source§impl Clone for DataflowGraph
impl Clone for DataflowGraph
Source§fn clone(&self) -> DataflowGraph
fn clone(&self) -> DataflowGraph
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 moreAuto Trait Implementations§
impl DynSend for DataflowGraph
impl DynSync for DataflowGraph
impl Freeze for DataflowGraph
impl RefUnwindSafe for DataflowGraph
impl Send for DataflowGraph
impl Sync for DataflowGraph
impl Unpin for DataflowGraph
impl UnsafeUnpin for DataflowGraph
impl UnwindSafe for DataflowGraph
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more