mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Trim the places that will not be used.
This commit is contained in:
parent
38fa676330
commit
2b0bf3cf59
@ -675,6 +675,15 @@ impl Map {
|
||||
self.cache_preorder_invoke(place);
|
||||
}
|
||||
}
|
||||
|
||||
// Trim useless places.
|
||||
for opt_place in self.locals.iter_mut() {
|
||||
if let Some(place) = *opt_place && self.inner_values[place].is_empty() {
|
||||
*opt_place = None;
|
||||
}
|
||||
}
|
||||
#[allow(rustc::potential_query_instability)]
|
||||
self.projections.retain(|_, child| !self.inner_values[*child].is_empty());
|
||||
}
|
||||
|
||||
/// Potentially register the (local, projection) place and its fields, recursively.
|
||||
@ -803,7 +812,7 @@ impl Map {
|
||||
tail_elem: Option<TrackElem>,
|
||||
f: &mut impl FnMut(ValueIndex),
|
||||
) {
|
||||
if place.is_indirect() {
|
||||
if place.has_deref() {
|
||||
// We do not track indirect places.
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user