pub struct DataflowAnalysis {
pub live_variables: HashMap<String, HashSet<String>>,
pub reaching_defs: HashMap<String, HashSet<String>>,
pub available_exprs: HashSet<String>,
pub use_def_chains: HashMap<String, Vec<String>>,
pub def_use_chains: HashMap<String, Vec<String>>,
}Expand description
Result of dataflow analysis on an expression.
Fields§
§live_variables: HashMap<String, HashSet<String>>Variables that are live (may be used later) at each expression
reaching_defs: HashMap<String, HashSet<String>>Reaching definitions for each variable
available_exprs: HashSet<String>Available expressions at each program point
use_def_chains: HashMap<String, Vec<String>>Use-def chains mapping uses to their definitions
def_use_chains: HashMap<String, Vec<String>>Def-use chains mapping definitions to their uses
Implementations§
Source§impl DataflowAnalysis
impl DataflowAnalysis
Sourcepub fn is_live(&self, expr_id: &str, var: &str) -> bool
pub fn is_live(&self, expr_id: &str, var: &str) -> bool
Check if a variable is live at a given point.
Sourcepub fn get_live_vars(&self, expr_id: &str) -> HashSet<String>
pub fn get_live_vars(&self, expr_id: &str) -> HashSet<String>
Get all live variables at a given point.
Sourcepub fn get_reaching_defs(&self, var: &str) -> HashSet<String>
pub fn get_reaching_defs(&self, var: &str) -> HashSet<String>
Get reaching definitions for a variable.
Sourcepub fn is_available(&self, expr: &str) -> bool
pub fn is_available(&self, expr: &str) -> bool
Check if an expression is available at a point.
Sourcepub fn get_use_def_chain(&self, var: &str) -> Vec<String>
pub fn get_use_def_chain(&self, var: &str) -> Vec<String>
Get use-def chain for a variable use.
Sourcepub fn get_def_use_chain(&self, var: &str) -> Vec<String>
pub fn get_def_use_chain(&self, var: &str) -> Vec<String>
Get def-use chain for a variable definition.
Trait Implementations§
Source§impl Clone for DataflowAnalysis
impl Clone for DataflowAnalysis
Source§fn clone(&self) -> DataflowAnalysis
fn clone(&self) -> DataflowAnalysis
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 DataflowAnalysis
impl Debug for DataflowAnalysis
Auto Trait Implementations§
impl Freeze for DataflowAnalysis
impl RefUnwindSafe for DataflowAnalysis
impl Send for DataflowAnalysis
impl Sync for DataflowAnalysis
impl Unpin for DataflowAnalysis
impl UnwindSafe for DataflowAnalysis
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