pub struct AndersenSolver {
pub constraints: Vec<AndersenConstraint>,
pub graph: PointsToGraph,
pub field_sensitive: bool,
pub iterations: u32,
}Expand description
Inclusion-based (Andersen) points-to solver.
Processes constraints until a fixed point is reached. Optionally field-sensitive.
Fields§
§constraints: Vec<AndersenConstraint>Accumulated constraints.
graph: PointsToGraphCurrent points-to graph.
field_sensitive: boolWhether to use field-sensitive analysis.
iterations: u32Number of solver iterations performed.
Implementations§
Source§impl AndersenSolver
impl AndersenSolver
Sourcepub fn field_sensitive() -> Self
pub fn field_sensitive() -> Self
Create a field-sensitive solver.
Sourcepub fn add_address_of(&mut self, lhs: LcnfVarId, addr_of: LcnfVarId)
pub fn add_address_of(&mut self, lhs: LcnfVarId, addr_of: LcnfVarId)
Add an AddressOf constraint: lhs ⊇ {&addr_of}.
Sourcepub fn add_copy(&mut self, lhs: LcnfVarId, rhs: LcnfVarId)
pub fn add_copy(&mut self, lhs: LcnfVarId, rhs: LcnfVarId)
Add a Copy constraint: pts(lhs) ⊇ pts(rhs).
Sourcepub fn add_store(&mut self, ptr: LcnfVarId, rhs: LcnfVarId)
pub fn add_store(&mut self, ptr: LcnfVarId, rhs: LcnfVarId)
Add a Store constraint: *ptr = rhs.
Sourcepub fn register_var(&mut self, node: PointsToNode)
pub fn register_var(&mut self, node: PointsToNode)
Register a variable in the underlying points-to graph.
Sourcepub fn solve(&mut self)
pub fn solve(&mut self)
Solve constraints to a fixed point.
Uses a worklist algorithm for efficiency.
Sourcepub fn query(&self, a: LcnfVarId, b: LcnfVarId) -> AliasResult
pub fn query(&self, a: LcnfVarId, b: LcnfVarId) -> AliasResult
Query alias relationship between two variables after solving.
Trait Implementations§
Source§impl Clone for AndersenSolver
impl Clone for AndersenSolver
Source§fn clone(&self) -> AndersenSolver
fn clone(&self) -> AndersenSolver
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 AndersenSolver
impl Debug for AndersenSolver
Source§impl Default for AndersenSolver
impl Default for AndersenSolver
Source§fn default() -> AndersenSolver
fn default() -> AndersenSolver
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AndersenSolver
impl RefUnwindSafe for AndersenSolver
impl Send for AndersenSolver
impl Sync for AndersenSolver
impl Unpin for AndersenSolver
impl UnsafeUnpin for AndersenSolver
impl UnwindSafe for AndersenSolver
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