Lattice meet operation when merging initial block states from multiple predecessors. This only keeps the common subset of values between the two incoming states. This also records whether any changes occurs, which helps determine when a fixed point has been reached.
(&mut self, other: &Self, changed: &mut bool)
| 64 | /// This also records whether any changes occurs, which helps determine when |
| 65 | /// a fixed point has been reached. |
| 66 | fn meet(&mut self, other: &Self, changed: &mut bool) { |
| 67 | self.unit_values.retain(|unit, values| { |
| 68 | if let Some(other_values) = other.unit_values.get(unit) { |
| 69 | values.retain(|&mut value| { |
| 70 | if !other_values.contains(&value) { |
| 71 | *changed = true; |
| 72 | false |
| 73 | } else { |
| 74 | true |
| 75 | } |
| 76 | }); |
| 77 | !values.is_empty() |
| 78 | } else { |
| 79 | *changed = !values.is_empty(); |
| 80 | false |
| 81 | } |
| 82 | }); |
| 83 | } |
| 84 | |
| 85 | /// Removes the given value from all `AllocationUnit`s. |
| 86 | /// |
no test coverage detected