pub trait SSAStatement<Cfg: SSAConfig>: Clone {
fn variables_written(&self) -> HashSet<Cfg::Variable>;
fn new_phi_statement(name: &Cfg::Variable, env: &Cfg::Environment) -> Self;
fn is_phi_statement(&self) -> bool;
fn is_phi_statement_for(&self, var: &Cfg::Variable) -> bool;
fn ensure_phi_argument(&mut self, env: &Cfg::Environment);
fn insert_ssa_variables(
&mut self,
env: &mut Cfg::Environment
) -> SSAResult<()>;
}Expand description
A statement in the language.
Required Methods
sourcefn variables_written(&self) -> HashSet<Cfg::Variable>
fn variables_written(&self) -> HashSet<Cfg::Variable>
Returns the set of variables written by statement.
sourcefn new_phi_statement(name: &Cfg::Variable, env: &Cfg::Environment) -> Self
fn new_phi_statement(name: &Cfg::Variable, env: &Cfg::Environment) -> Self
Returns a new phi statement (with empty RHS) for the given variable.
sourcefn is_phi_statement(&self) -> bool
fn is_phi_statement(&self) -> bool
Returns true iff the statement is a phi statement.
sourcefn is_phi_statement_for(&self, var: &Cfg::Variable) -> bool
fn is_phi_statement_for(&self, var: &Cfg::Variable) -> bool
Returns true iff the statement is a phi statement for the given variable.
sourcefn ensure_phi_argument(&mut self, env: &Cfg::Environment)
fn ensure_phi_argument(&mut self, env: &Cfg::Environment)
Ensure that the phi expression argument list of a phi statement contains the current version of the variable, according to the given environment.
Panics if the statement is not a phi statement.
sourcefn insert_ssa_variables(&mut self, env: &mut Cfg::Environment) -> SSAResult<()>
fn insert_ssa_variables(&mut self, env: &mut Cfg::Environment) -> SSAResult<()>
Replace each variable occurring in the statement by the corresponding versioned SSA variable.