diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs index addea2c9b87..9dcd5f22a2d 100644 --- a/compiler/rustc_mir_dataflow/src/value_analysis.rs +++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs @@ -474,26 +474,10 @@ impl State { } } - pub fn is_reachable(&self) -> bool { + fn is_reachable(&self) -> bool { matches!(&self.0, StateData::Reachable(_)) } - pub fn mark_unreachable(&mut self) { - self.0 = StateData::Unreachable; - } - - pub fn flood_all(&mut self) - where - V: HasTop, - { - self.flood_all_with(V::TOP) - } - - pub fn flood_all_with(&mut self, value: V) { - let StateData::Reachable(values) = &mut self.0 else { return }; - values.raw.fill(value); - } - /// Assign `value` to all places that are contained in `place` or may alias one. pub fn flood_with(&mut self, place: PlaceRef<'_>, map: &Map, value: V) { self.flood_with_tail_elem(place, None, map, value) @@ -508,7 +492,7 @@ impl State { } /// Assign `value` to the discriminant of `place` and all places that may alias it. - pub fn flood_discr_with(&mut self, place: PlaceRef<'_>, map: &Map, value: V) { + fn flood_discr_with(&mut self, place: PlaceRef<'_>, map: &Map, value: V) { self.flood_with_tail_elem(place, Some(TrackElem::Discriminant), map, value) } @@ -544,7 +528,7 @@ impl State { /// This does nothing if the place is not tracked. /// /// The target place must have been flooded before calling this method. - pub fn insert_idx(&mut self, target: PlaceIndex, result: ValueOrPlace, map: &Map) { + fn insert_idx(&mut self, target: PlaceIndex, result: ValueOrPlace, map: &Map) { match result { ValueOrPlace::Value(value) => self.insert_value_idx(target, value, map), ValueOrPlace::Place(source) => self.insert_place_idx(target, source, map), @@ -908,11 +892,6 @@ impl Map { self.inner_values[root] = start..end; } - /// Returns the number of tracked places, i.e., those for which a value can be stored. - pub fn tracked_places(&self) -> usize { - self.value_count - } - /// Applies a single projection element, yielding the corresponding child. pub fn apply(&self, place: PlaceIndex, elem: TrackElem) -> Option { self.projections.get(&(place, elem)).copied() @@ -952,7 +931,7 @@ impl Map { } /// Iterate over all direct children. - pub fn children(&self, parent: PlaceIndex) -> impl Iterator + '_ { + fn children(&self, parent: PlaceIndex) -> impl Iterator + '_ { Children::new(self, parent) }