|
5 | 5 | use std::fmt; |
6 | 6 | use std::marker::PhantomData; |
7 | 7 |
|
8 | | -use rustc_index::bit_set::BitSet; |
| 8 | +use rustc_index::bit_set::MixedBitSet; |
9 | 9 | use rustc_middle::mir::visit::Visitor; |
10 | 10 | use rustc_middle::mir::{ |
11 | 11 | self, BasicBlock, CallReturnPlaces, Local, Location, Statement, StatementKind, TerminatorEdges, |
@@ -246,12 +246,14 @@ where |
246 | 246 | } |
247 | 247 |
|
248 | 248 | #[derive(Debug, PartialEq, Eq)] |
| 249 | +/// The state for the `FlowSensitiveAnalysis` dataflow analysis. This domain is likely homogeneous, |
| 250 | +/// and has a big size, so we use a bitset that can be sparse (c.f. issue #134404). |
249 | 251 | pub(super) struct State { |
250 | 252 | /// Describes whether a local contains qualif. |
251 | | - pub qualif: BitSet<Local>, |
| 253 | + pub qualif: MixedBitSet<Local>, |
252 | 254 | /// Describes whether a local's address escaped and it might become qualified as a result an |
253 | 255 | /// indirect mutation. |
254 | | - pub borrow: BitSet<Local>, |
| 256 | + pub borrow: MixedBitSet<Local>, |
255 | 257 | } |
256 | 258 |
|
257 | 259 | impl Clone for State { |
@@ -320,8 +322,8 @@ where |
320 | 322 |
|
321 | 323 | fn bottom_value(&self, body: &mir::Body<'tcx>) -> Self::Domain { |
322 | 324 | State { |
323 | | - qualif: BitSet::new_empty(body.local_decls.len()), |
324 | | - borrow: BitSet::new_empty(body.local_decls.len()), |
| 325 | + qualif: MixedBitSet::new_empty(body.local_decls.len()), |
| 326 | + borrow: MixedBitSet::new_empty(body.local_decls.len()), |
325 | 327 | } |
326 | 328 | } |
327 | 329 |
|
|
0 commit comments