pub struct PointsToGraph {
pub nodes: HashMap<LcnfVarId, PointsToNode>,
pub pts: HashMap<LcnfVarId, HashSet<LcnfVarId>>,
pub is_steensgaard: bool,
}Expand description
A points-to graph mapping each variable to the set of nodes it may point to.
This implements a simplified Andersen / Steensgaard style analysis.
Fields§
§nodes: HashMap<LcnfVarId, PointsToNode>All known nodes in the graph.
pts: HashMap<LcnfVarId, HashSet<LcnfVarId>>pts[x] = set of node IDs that variable x may point to.
is_steensgaard: boolWhether this graph was built with Steensgaard (union-find) or Andersen style.
Implementations§
Source§impl PointsToGraph
impl PointsToGraph
Sourcepub fn add_node(&mut self, node: PointsToNode)
pub fn add_node(&mut self, node: PointsToNode)
Register a node in the graph.
Sourcepub fn add_pts(&mut self, src: LcnfVarId, tgt: LcnfVarId)
pub fn add_pts(&mut self, src: LcnfVarId, tgt: LcnfVarId)
Add a points-to edge: src may point to tgt.
Sourcepub fn pts_of(&self, var: LcnfVarId) -> &HashSet<LcnfVarId>
pub fn pts_of(&self, var: LcnfVarId) -> &HashSet<LcnfVarId>
Retrieve the points-to set for var.
Sourcepub fn intersects(&self, a: LcnfVarId, b: LcnfVarId) -> bool
pub fn intersects(&self, a: LcnfVarId, b: LcnfVarId) -> bool
Check whether two variables share a common points-to target.
Trait Implementations§
Source§impl Clone for PointsToGraph
impl Clone for PointsToGraph
Source§fn clone(&self) -> PointsToGraph
fn clone(&self) -> PointsToGraph
Returns a duplicate of the value. Read more
1.0.0 · 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 PointsToGraph
impl Debug for PointsToGraph
Source§impl Default for PointsToGraph
impl Default for PointsToGraph
Source§fn default() -> PointsToGraph
fn default() -> PointsToGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PointsToGraph
impl RefUnwindSafe for PointsToGraph
impl Send for PointsToGraph
impl Sync for PointsToGraph
impl Unpin for PointsToGraph
impl UnsafeUnpin for PointsToGraph
impl UnwindSafe for PointsToGraph
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