pub struct CanonicalReplacer { /* private fields */ }
Implementations§
source§impl CanonicalReplacer
impl CanonicalReplacer
A replacer that replace the Ids in the program with canonical onces. The canonical ids are defined by the order of the declaration in the program. The first type_id is 0, the second type id is 1, etc.
sourcepub fn from_program(program: &Program) -> Self
pub fn from_program(program: &Program) -> Self
Builds a replacer from a program.
Trait Implementations§
source§impl Default for CanonicalReplacer
impl Default for CanonicalReplacer
source§fn default() -> CanonicalReplacer
fn default() -> CanonicalReplacer
Returns the “default value” for a type. Read more
source§impl SierraIdReplacer for CanonicalReplacer
impl SierraIdReplacer for CanonicalReplacer
fn replace_libfunc_id(&self, id: &ConcreteLibfuncId) -> ConcreteLibfuncId
fn replace_type_id(&self, id: &ConcreteTypeId) -> ConcreteTypeId
fn replace_function_id(&self, id: &FunctionId) -> FunctionId
source§fn apply(&self, program: &Program) -> Program
fn apply(&self, program: &Program) -> Program
Returns a new program where all the ids are replaced.