pub trait SSAStatement<Cfg: SSAConfig>: Clone {
    // Required methods
    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§

source

fn variables_written(&self) -> HashSet<Cfg::Variable>

Returns the set of variables written by statement.

source

fn new_phi_statement(name: &Cfg::Variable, env: &Cfg::Environment) -> Self

Returns a new phi statement (with empty RHS) for the given variable.

source

fn is_phi_statement(&self) -> bool

Returns true iff the statement is a phi statement.

source

fn is_phi_statement_for(&self, var: &Cfg::Variable) -> bool

Returns true iff the statement is a phi statement for the given variable.

source

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.

source

fn insert_ssa_variables(&mut self, env: &mut Cfg::Environment) -> SSAResult<()>

Replace each variable occurring in the statement by the corresponding versioned SSA variable.

Implementors§