pub struct AbstractGraph {
pub node_ops: HashMap<NodeId, AbstractNodeOp>,
pub predecessors: HashMap<NodeId, Vec<NodeId>>,
pub successors: HashMap<NodeId, Vec<NodeId>>,
pub entry_nodes: Vec<NodeId>,
pub exit_nodes: Vec<NodeId>,
}Expand description
Abstract representation of a ComputationGraph used by the
abstract interpreter.
The structure stores per-node operation kinds plus pre-computed successor/predecessor adjacency in topological-friendly form so the Kildall fixed-point worklist can iterate without paying for repeated graph queries.
Fields§
§node_ops: HashMap<NodeId, AbstractNodeOp>Operation kind for each node.
predecessors: HashMap<NodeId, Vec<NodeId>>Operands (predecessors) of each node, in input order.
successors: HashMap<NodeId, Vec<NodeId>>Successors of each node.
entry_nodes: Vec<NodeId>Nodes with no predecessors (entries to the analysis).
exit_nodes: Vec<NodeId>Nodes with no successors (analysis sinks).
Implementations§
Source§impl AbstractGraph
impl AbstractGraph
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of nodes in the graph.
Sourcepub fn successors_of(&self, node: NodeId) -> &[NodeId] ⓘ
pub fn successors_of(&self, node: NodeId) -> &[NodeId] ⓘ
Successors of node (empty slice if none).
Sourcepub fn predecessors_of(&self, node: NodeId) -> &[NodeId] ⓘ
pub fn predecessors_of(&self, node: NodeId) -> &[NodeId] ⓘ
Predecessors of node (empty slice if none).
Trait Implementations§
Source§impl Clone for AbstractGraph
impl Clone for AbstractGraph
Source§fn clone(&self) -> AbstractGraph
fn clone(&self) -> AbstractGraph
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 AbstractGraph
impl Debug for AbstractGraph
Source§impl Default for AbstractGraph
impl Default for AbstractGraph
Source§fn default() -> AbstractGraph
fn default() -> AbstractGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AbstractGraph
impl RefUnwindSafe for AbstractGraph
impl Send for AbstractGraph
impl Sync for AbstractGraph
impl Unpin for AbstractGraph
impl UnsafeUnpin for AbstractGraph
impl UnwindSafe for AbstractGraph
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