@@ -18,7 +18,7 @@ pub trait Direction {
1818 /// `effects.start()` must precede or equal `effects.end()` in this direction.
1919 fn apply_effects_in_range < A > (
2020 analysis : & A ,
21- state : & mut BitSet < A :: Idx > ,
21+ state : & mut A :: Domain ,
2222 block : BasicBlock ,
2323 block_data : & mir:: BasicBlockData < ' tcx > ,
2424 effects : RangeInclusive < EffectIndex > ,
@@ -27,7 +27,7 @@ pub trait Direction {
2727
2828 fn apply_effects_in_block < A > (
2929 analysis : & A ,
30- state : & mut BitSet < A :: Idx > ,
30+ state : & mut A :: Domain ,
3131 block : BasicBlock ,
3232 block_data : & mir:: BasicBlockData < ' tcx > ,
3333 ) where
@@ -55,9 +55,9 @@ pub trait Direction {
5555 tcx : TyCtxt < ' tcx > ,
5656 body : & mir:: Body < ' tcx > ,
5757 dead_unwinds : Option < & BitSet < BasicBlock > > ,
58- exit_state : & mut BitSet < A :: Idx > ,
58+ exit_state : & mut A :: Domain ,
5959 block : ( BasicBlock , & ' _ mir:: BasicBlockData < ' tcx > ) ,
60- propagate : impl FnMut ( BasicBlock , & BitSet < A :: Idx > ) ,
60+ propagate : impl FnMut ( BasicBlock , & A :: Domain ) ,
6161 ) where
6262 A : Analysis < ' tcx > ;
6363}
@@ -72,7 +72,7 @@ impl Direction for Backward {
7272
7373 fn apply_effects_in_block < A > (
7474 analysis : & A ,
75- state : & mut BitSet < A :: Idx > ,
75+ state : & mut A :: Domain ,
7676 block : BasicBlock ,
7777 block_data : & mir:: BasicBlockData < ' tcx > ,
7878 ) where
@@ -112,7 +112,7 @@ impl Direction for Backward {
112112
113113 fn apply_effects_in_range < A > (
114114 analysis : & A ,
115- state : & mut BitSet < A :: Idx > ,
115+ state : & mut A :: Domain ,
116116 block : BasicBlock ,
117117 block_data : & mir:: BasicBlockData < ' tcx > ,
118118 effects : RangeInclusive < EffectIndex > ,
@@ -224,9 +224,9 @@ impl Direction for Backward {
224224 _tcx : TyCtxt < ' tcx > ,
225225 body : & mir:: Body < ' tcx > ,
226226 dead_unwinds : Option < & BitSet < BasicBlock > > ,
227- exit_state : & mut BitSet < A :: Idx > ,
227+ exit_state : & mut A :: Domain ,
228228 ( bb, _bb_data) : ( BasicBlock , & ' _ mir:: BasicBlockData < ' tcx > ) ,
229- mut propagate : impl FnMut ( BasicBlock , & BitSet < A :: Idx > ) ,
229+ mut propagate : impl FnMut ( BasicBlock , & A :: Domain ) ,
230230 ) where
231231 A : Analysis < ' tcx > ,
232232 {
@@ -281,7 +281,7 @@ impl Direction for Forward {
281281
282282 fn apply_effects_in_block < A > (
283283 analysis : & A ,
284- state : & mut BitSet < A :: Idx > ,
284+ state : & mut A :: Domain ,
285285 block : BasicBlock ,
286286 block_data : & mir:: BasicBlockData < ' tcx > ,
287287 ) where
@@ -321,7 +321,7 @@ impl Direction for Forward {
321321
322322 fn apply_effects_in_range < A > (
323323 analysis : & A ,
324- state : & mut BitSet < A :: Idx > ,
324+ state : & mut A :: Domain ,
325325 block : BasicBlock ,
326326 block_data : & mir:: BasicBlockData < ' tcx > ,
327327 effects : RangeInclusive < EffectIndex > ,
@@ -428,9 +428,9 @@ impl Direction for Forward {
428428 tcx : TyCtxt < ' tcx > ,
429429 body : & mir:: Body < ' tcx > ,
430430 dead_unwinds : Option < & BitSet < BasicBlock > > ,
431- exit_state : & mut BitSet < A :: Idx > ,
431+ exit_state : & mut A :: Domain ,
432432 ( bb, bb_data) : ( BasicBlock , & ' _ mir:: BasicBlockData < ' tcx > ) ,
433- mut propagate : impl FnMut ( BasicBlock , & BitSet < A :: Idx > ) ,
433+ mut propagate : impl FnMut ( BasicBlock , & A :: Domain ) ,
434434 ) where
435435 A : Analysis < ' tcx > ,
436436 {
@@ -499,7 +499,7 @@ impl Direction for Forward {
499499 // MIR building adds discriminants to the `values` array in the same order as they
500500 // are yielded by `AdtDef::discriminants`. We rely on this to match each
501501 // 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 ) ;
503503 let mut discriminants = enum_def. discriminants ( tcx) ;
504504 for ( value, target) in values. iter ( ) . zip ( targets. iter ( ) . copied ( ) ) {
505505 let ( variant_idx, _) =
@@ -508,7 +508,7 @@ impl Direction for Forward {
508508 from that of `SwitchInt::values`",
509509 ) ;
510510
511- tmp. overwrite ( exit_state) ;
511+ tmp. clone_from ( exit_state) ;
512512 analysis. apply_discriminant_switch_effect (
513513 & mut tmp,
514514 bb,
0 commit comments