pub struct ConstPropState {
pub values: HashMap<String, Option<i64>>,
}Expand description
A simple constant propagation state: maps variables to known constant values or marks them as non-constant (⊤).
Fields§
§values: HashMap<String, Option<i64>>None = unknown/non-constant (⊤); Some(v) = definitely v.
Implementations§
Source§impl ConstPropState
impl ConstPropState
Sourcepub fn set_const(&mut self, var: impl Into<String>, val: i64)
pub fn set_const(&mut self, var: impl Into<String>, val: i64)
Define a variable as a known constant.
Sourcepub fn join(&self, other: &ConstPropState) -> ConstPropState
pub fn join(&self, other: &ConstPropState) -> ConstPropState
Join two states (meet of constant info: agree ⇒ keep, disagree ⇒ top).
Trait Implementations§
Source§impl Clone for ConstPropState
impl Clone for ConstPropState
Source§fn clone(&self) -> ConstPropState
fn clone(&self) -> ConstPropState
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 ConstPropState
impl Debug for ConstPropState
Source§impl Default for ConstPropState
impl Default for ConstPropState
Source§fn default() -> ConstPropState
fn default() -> ConstPropState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConstPropState
impl RefUnwindSafe for ConstPropState
impl Send for ConstPropState
impl Sync for ConstPropState
impl Unpin for ConstPropState
impl UnsafeUnpin for ConstPropState
impl UnwindSafe for ConstPropState
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