@@ -18,7 +18,7 @@ pub trait Direction {
18
18
/// `effects.start()` must precede or equal `effects.end()` in this direction.
19
19
fn apply_effects_in_range < A > (
20
20
analysis : & A ,
21
- state : & mut BitSet < A :: Idx > ,
21
+ state : & mut A :: Domain ,
22
22
block : BasicBlock ,
23
23
block_data : & mir:: BasicBlockData < ' tcx > ,
24
24
effects : RangeInclusive < EffectIndex > ,
@@ -27,7 +27,7 @@ pub trait Direction {
27
27
28
28
fn apply_effects_in_block < A > (
29
29
analysis : & A ,
30
- state : & mut BitSet < A :: Idx > ,
30
+ state : & mut A :: Domain ,
31
31
block : BasicBlock ,
32
32
block_data : & mir:: BasicBlockData < ' tcx > ,
33
33
) where
@@ -55,9 +55,9 @@ pub trait Direction {
55
55
tcx : TyCtxt < ' tcx > ,
56
56
body : & mir:: Body < ' tcx > ,
57
57
dead_unwinds : Option < & BitSet < BasicBlock > > ,
58
- exit_state : & mut BitSet < A :: Idx > ,
58
+ exit_state : & mut A :: Domain ,
59
59
block : ( BasicBlock , & ' _ mir:: BasicBlockData < ' tcx > ) ,
60
- propagate : impl FnMut ( BasicBlock , & BitSet < A :: Idx > ) ,
60
+ propagate : impl FnMut ( BasicBlock , & A :: Domain ) ,
61
61
) where
62
62
A : Analysis < ' tcx > ;
63
63
}
@@ -72,7 +72,7 @@ impl Direction for Backward {
72
72
73
73
fn apply_effects_in_block < A > (
74
74
analysis : & A ,
75
- state : & mut BitSet < A :: Idx > ,
75
+ state : & mut A :: Domain ,
76
76
block : BasicBlock ,
77
77
block_data : & mir:: BasicBlockData < ' tcx > ,
78
78
) where
@@ -112,7 +112,7 @@ impl Direction for Backward {
112
112
113
113
fn apply_effects_in_range < A > (
114
114
analysis : & A ,
115
- state : & mut BitSet < A :: Idx > ,
115
+ state : & mut A :: Domain ,
116
116
block : BasicBlock ,
117
117
block_data : & mir:: BasicBlockData < ' tcx > ,
118
118
effects : RangeInclusive < EffectIndex > ,
@@ -224,9 +224,9 @@ impl Direction for Backward {
224
224
_tcx : TyCtxt < ' tcx > ,
225
225
body : & mir:: Body < ' tcx > ,
226
226
dead_unwinds : Option < & BitSet < BasicBlock > > ,
227
- exit_state : & mut BitSet < A :: Idx > ,
227
+ exit_state : & mut A :: Domain ,
228
228
( bb, _bb_data) : ( BasicBlock , & ' _ mir:: BasicBlockData < ' tcx > ) ,
229
- mut propagate : impl FnMut ( BasicBlock , & BitSet < A :: Idx > ) ,
229
+ mut propagate : impl FnMut ( BasicBlock , & A :: Domain ) ,
230
230
) where
231
231
A : Analysis < ' tcx > ,
232
232
{
@@ -281,7 +281,7 @@ impl Direction for Forward {
281
281
282
282
fn apply_effects_in_block < A > (
283
283
analysis : & A ,
284
- state : & mut BitSet < A :: Idx > ,
284
+ state : & mut A :: Domain ,
285
285
block : BasicBlock ,
286
286
block_data : & mir:: BasicBlockData < ' tcx > ,
287
287
) where
@@ -321,7 +321,7 @@ impl Direction for Forward {
321
321
322
322
fn apply_effects_in_range < A > (
323
323
analysis : & A ,
324
- state : & mut BitSet < A :: Idx > ,
324
+ state : & mut A :: Domain ,
325
325
block : BasicBlock ,
326
326
block_data : & mir:: BasicBlockData < ' tcx > ,
327
327
effects : RangeInclusive < EffectIndex > ,
@@ -428,9 +428,9 @@ impl Direction for Forward {
428
428
tcx : TyCtxt < ' tcx > ,
429
429
body : & mir:: Body < ' tcx > ,
430
430
dead_unwinds : Option < & BitSet < BasicBlock > > ,
431
- exit_state : & mut BitSet < A :: Idx > ,
431
+ exit_state : & mut A :: Domain ,
432
432
( bb, bb_data) : ( BasicBlock , & ' _ mir:: BasicBlockData < ' tcx > ) ,
433
- mut propagate : impl FnMut ( BasicBlock , & BitSet < A :: Idx > ) ,
433
+ mut propagate : impl FnMut ( BasicBlock , & A :: Domain ) ,
434
434
) where
435
435
A : Analysis < ' tcx > ,
436
436
{
@@ -499,7 +499,7 @@ impl Direction for Forward {
499
499
// MIR building adds discriminants to the `values` array in the same order as they
500
500
// are yielded by `AdtDef::discriminants`. We rely on this to match each
501
501
// discriminant in `values` to its corresponding variant in linear time.
502
- let mut tmp = BitSet :: new_empty ( exit_state . domain_size ( ) ) ;
502
+ let mut tmp = analysis . bottom_value ( body ) ;
503
503
let mut discriminants = enum_def. discriminants ( tcx) ;
504
504
for ( value, target) in values. iter ( ) . zip ( targets. iter ( ) . copied ( ) ) {
505
505
let ( variant_idx, _) =
@@ -508,7 +508,7 @@ impl Direction for Forward {
508
508
from that of `SwitchInt::values`",
509
509
) ;
510
510
511
- tmp. overwrite ( exit_state) ;
511
+ tmp. clone_from ( exit_state) ;
512
512
analysis. apply_discriminant_switch_effect (
513
513
& mut tmp,
514
514
bb,
0 commit comments