Polonius: don't emit region_live_at

This commit is contained in:
Albin Stjerna 2019-08-16 15:42:22 +02:00
parent 6568b086a2
commit 9cd1a11571
3 changed files with 1 additions and 20 deletions

View File

@ -58,7 +58,6 @@ impl AllFactsExt for AllFacts {
cfg_edge,
killed,
outlives,
region_live_at,
invalidates,
var_used,
var_defined,

View File

@ -58,7 +58,7 @@ pub(super) fn generate<'tcx>(
};
if !live_locals.is_empty() {
trace::trace(typeck, body, elements, flow_inits, move_data, live_locals, location_table);
trace::trace(typeck, body, elements, flow_inits, move_data, live_locals);
polonius::populate_var_liveness_facts(typeck, body, location_table);
}

View File

@ -1,4 +1,3 @@
use crate::borrow_check::location::LocationTable;
use crate::borrow_check::nll::region_infer::values::{self, PointIndex, RegionValueElements};
use crate::borrow_check::nll::type_check::liveness::local_use_map::LocalUseMap;
use crate::borrow_check::nll::type_check::liveness::polonius;
@ -38,7 +37,6 @@ pub(super) fn trace(
flow_inits: &mut FlowAtLocation<'tcx, MaybeInitializedPlaces<'_, 'tcx>>,
move_data: &MoveData<'tcx>,
live_locals: Vec<Local>,
location_table: &LocationTable,
) {
debug!("trace()");
@ -52,7 +50,6 @@ pub(super) fn trace(
local_use_map,
move_data,
drop_data: FxHashMap::default(),
location_table,
};
LivenessResults::new(cx).compute_for_all_locals(live_locals);
@ -82,9 +79,6 @@ struct LivenessContext<'me, 'typeck, 'flow, 'tcx> {
/// Index indicating where each variable is assigned, used, or
/// dropped.
local_use_map: &'me LocalUseMap,
/// Maps between a MIR Location and a LocationIndex
location_table: &'me LocationTable,
}
struct DropData<'tcx> {
@ -405,7 +399,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
&mut self.typeck,
value,
live_at,
self.location_table,
)
}
@ -462,7 +455,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
&mut self.typeck,
kind,
live_at,
self.location_table,
);
polonius::add_var_drops_regions(&mut self.typeck, dropped_local, &kind);
@ -474,7 +466,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
typeck: &mut TypeChecker<'_, 'tcx>,
value: impl TypeFoldable<'tcx>,
live_at: &HybridBitSet<PointIndex>,
location_table: &LocationTable,
) {
debug!("make_all_regions_live(value={:?})", value);
debug!(
@ -491,15 +482,6 @@ impl LivenessContext<'_, '_, '_, 'tcx> {
.constraints
.liveness_constraints
.add_elements(live_region_vid, live_at);
// FIXME: remove this when we can generate our own region-live-at reliably
if let Some(facts) = typeck.borrowck_context.all_facts {
for point in live_at.iter() {
let loc = elements.to_location(point);
facts.region_live_at.push((live_region_vid, location_table.start_index(loc)));
facts.region_live_at.push((live_region_vid, location_table.mid_index(loc)));
}
}
});
}