Remove uses of HybridBitSet.
This commit is contained in:
parent
d5fd099729
commit
7e64de431e
@ -1,6 +1,6 @@
|
|||||||
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
|
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
|
||||||
use rustc_data_structures::graph::WithSuccessors;
|
use rustc_data_structures::graph::WithSuccessors;
|
||||||
use rustc_index::bit_set::HybridBitSet;
|
use rustc_index::bit_set::BitSet;
|
||||||
use rustc_index::interval::IntervalSet;
|
use rustc_index::interval::IntervalSet;
|
||||||
use rustc_infer::infer::canonical::QueryRegionConstraints;
|
use rustc_infer::infer::canonical::QueryRegionConstraints;
|
||||||
use rustc_infer::infer::outlives::for_liveness;
|
use rustc_infer::infer::outlives::for_liveness;
|
||||||
@ -135,7 +135,7 @@ struct LivenessResults<'me, 'typeck, 'flow, 'tcx> {
|
|||||||
cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>,
|
cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>,
|
||||||
|
|
||||||
/// Set of points that define the current local.
|
/// Set of points that define the current local.
|
||||||
defs: HybridBitSet<PointIndex>,
|
defs: BitSet<PointIndex>,
|
||||||
|
|
||||||
/// Points where the current variable is "use live" -- meaning
|
/// Points where the current variable is "use live" -- meaning
|
||||||
/// that there is a future "full use" that may use its value.
|
/// that there is a future "full use" that may use its value.
|
||||||
@ -158,7 +158,7 @@ fn new(cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>) -> Self {
|
|||||||
let num_points = cx.elements.num_points();
|
let num_points = cx.elements.num_points();
|
||||||
LivenessResults {
|
LivenessResults {
|
||||||
cx,
|
cx,
|
||||||
defs: HybridBitSet::new_empty(num_points),
|
defs: BitSet::new_empty(num_points),
|
||||||
use_live_at: IntervalSet::new(num_points),
|
use_live_at: IntervalSet::new(num_points),
|
||||||
drop_live_at: IntervalSet::new(num_points),
|
drop_live_at: IntervalSet::new(num_points),
|
||||||
drop_locations: vec![],
|
drop_locations: vec![],
|
||||||
|
@ -284,7 +284,7 @@ fn reverse_union_sparse(&mut self, sparse: &SparseBitSet<T>) -> bool {
|
|||||||
not_already
|
not_already
|
||||||
}
|
}
|
||||||
|
|
||||||
fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T> {
|
pub fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T> {
|
||||||
let (start, end) = inclusive_start_end(range, self.domain_size)?;
|
let (start, end) = inclusive_start_end(range, self.domain_size)?;
|
||||||
let (start_word_index, _) = word_index_and_mask(start);
|
let (start_word_index, _) = word_index_and_mask(start);
|
||||||
let (end_word_index, end_mask) = word_index_and_mask(end);
|
let (end_word_index, end_mask) = word_index_and_mask(end);
|
||||||
@ -1299,7 +1299,7 @@ fn iter(&self) -> slice::Iter<'_, T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Idx + Ord> SparseBitSet<T> {
|
impl<T: Idx + Ord> SparseBitSet<T> {
|
||||||
fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T> {
|
pub fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T> {
|
||||||
let mut last_leq = None;
|
let mut last_leq = None;
|
||||||
for e in self.iter() {
|
for e in self.iter() {
|
||||||
if range.contains(e) {
|
if range.contains(e) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//! See the docs for [`RenameReturnPlace`].
|
//! See the docs for [`RenameReturnPlace`].
|
||||||
|
|
||||||
use rustc_hir::Mutability;
|
use rustc_hir::Mutability;
|
||||||
use rustc_index::bit_set::HybridBitSet;
|
use rustc_index::bit_set::BitSet;
|
||||||
use rustc_middle::mir::visit::{MutVisitor, NonUseContext, PlaceContext, Visitor};
|
use rustc_middle::mir::visit::{MutVisitor, NonUseContext, PlaceContext, Visitor};
|
||||||
use rustc_middle::mir::{self, BasicBlock, Local, Location};
|
use rustc_middle::mir::{self, BasicBlock, Local, Location};
|
||||||
use rustc_middle::ty::TyCtxt;
|
use rustc_middle::ty::TyCtxt;
|
||||||
@ -123,7 +123,7 @@ fn find_local_assigned_to_return_place(
|
|||||||
body: &mut mir::Body<'_>,
|
body: &mut mir::Body<'_>,
|
||||||
) -> Option<Local> {
|
) -> Option<Local> {
|
||||||
let mut block = start;
|
let mut block = start;
|
||||||
let mut seen = HybridBitSet::new_empty(body.basic_blocks.len());
|
let mut seen = BitSet::new_empty(body.basic_blocks.len());
|
||||||
|
|
||||||
// Iterate as long as `block` has exactly one predecessor that we have not yet visited.
|
// Iterate as long as `block` has exactly one predecessor that we have not yet visited.
|
||||||
while seen.insert(block) {
|
while seen.insert(block) {
|
||||||
|
Loading…
Reference in New Issue
Block a user