mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-09-11 13:56:58 +03:00
Add Mapping::get to necessary expressions that are preserved by DCE
This commit is contained in:
parent
06c24bbef9
commit
19eb828327
@ -32,9 +32,9 @@ impl ExpressionReconstructor for DeadCodeEliminator<'_> {
|
||||
|
||||
/// Reconstructs the associated function access expression.
|
||||
fn reconstruct_associated_function(&mut self, input: AssociatedFunction) -> (Expression, Self::AdditionalOutput) {
|
||||
// If the associated function manipulates a mapping, mark the statement as necessary.
|
||||
// If the associated function manipulates a mapping or has a side-effect, mark the statement as necessary.
|
||||
match (&input.variant.name, input.name.name) {
|
||||
(&sym::Mapping, sym::remove) | (&sym::Mapping, sym::set) => {
|
||||
(&sym::Mapping, sym::remove) | (&sym::Mapping, sym::set) | (&sym::Mapping, sym::get) => {
|
||||
self.is_necessary = true;
|
||||
}
|
||||
_ => {}
|
||||
|
Loading…
Reference in New Issue
Block a user