Skip to content

Commit

Permalink
Added default-implementation for map_block_id in Rebuilder. (#6354)
Browse files Browse the repository at this point in the history
  • Loading branch information
orizi authored Sep 5, 2024
1 parent aa6acc3 commit 26ba445
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions crates/cairo-lang-lowering/src/optimizations/remappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ impl Rebuilder for Context {
}
}

fn map_block_id(&mut self, block: BlockId) -> BlockId {
block
}

fn transform_remapping(&mut self, remapping: &mut VarRemapping) {
let mut new_remapping = VarRemapping::default();
for (dst, src) in remapping.iter() {
Expand Down
4 changes: 0 additions & 4 deletions crates/cairo-lang-lowering/src/reorganize_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,4 @@ impl Rebuilder for VarReassigner<'_> {
fn map_var_id(&mut self, var: VariableId) -> VariableId {
*self.vars.entry(var).or_insert_with(|| self.new_vars.alloc(self.old_vars[var].clone()))
}

fn map_block_id(&mut self, block: BlockId) -> BlockId {
block
}
}
4 changes: 3 additions & 1 deletion crates/cairo-lang-lowering/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ pub trait Rebuilder {
fn map_location(&mut self, location: LocationId) -> LocationId {
location
}
fn map_block_id(&mut self, block: BlockId) -> BlockId;
fn map_block_id(&mut self, block: BlockId) -> BlockId {
block
}
fn transform_statement(&mut self, _statement: &mut Statement) {}
fn transform_remapping(&mut self, _remapping: &mut VarRemapping) {}
fn transform_end(&mut self, _end: &mut FlatBlockEnd) {}
Expand Down

0 comments on commit 26ba445

Please sign in to comment.