@@ -9,7 +9,7 @@ use rustc::mir::{self, Body, Location, Local};
9
9
use rustc_index:: bit_set:: BitSet ;
10
10
use crate :: transform:: { MirPass , MirSource } ;
11
11
12
- use crate :: dataflow:: generic:: { Analysis , Results , ResultsCursor } ;
12
+ use crate :: dataflow:: generic:: { Analysis , Engine , Results , ResultsCursor } ;
13
13
use crate :: dataflow:: { do_dataflow, DebugFormatted } ;
14
14
use crate :: dataflow:: MoveDataParamEnv ;
15
15
use crate :: dataflow:: {
@@ -40,10 +40,11 @@ impl<'tcx> MirPass<'tcx> for SanityCheck {
40
40
let move_data = MoveData :: gather_moves ( body, tcx) . unwrap ( ) ;
41
41
let mdpe = MoveDataParamEnv { move_data : move_data, param_env : param_env } ;
42
42
let dead_unwinds = BitSet :: new_empty ( body. basic_blocks ( ) . len ( ) ) ;
43
- let flow_inits =
44
- do_dataflow ( tcx, body, def_id, & attributes, & dead_unwinds,
45
- MaybeInitializedPlaces :: new ( tcx, body, & mdpe) ,
46
- |bd, i| DebugFormatted :: new ( & bd. move_data ( ) . move_paths [ i] ) ) ;
43
+
44
+ let flow_inits = Engine :: new_gen_kill (
45
+ tcx, body, def_id, & dead_unwinds,
46
+ MaybeInitializedPlaces :: new ( tcx, body, & mdpe) ,
47
+ ) . iterate_to_fixpoint ( ) ;
47
48
let flow_uninits =
48
49
do_dataflow ( tcx, body, def_id, & attributes, & dead_unwinds,
49
50
MaybeUninitializedPlaces :: new ( tcx, body, & mdpe) ,
@@ -57,11 +58,15 @@ impl<'tcx> MirPass<'tcx> for SanityCheck {
57
58
IndirectlyMutableLocals :: new ( tcx, body, param_env) ,
58
59
|_, i| DebugFormatted :: new ( & i) ) ;
59
60
60
- // FIXME: add these back as dataflow analyses are migrated
61
- /*
62
61
if has_rustc_mir_with ( & attributes, sym:: rustc_peek_maybe_init) . is_some ( ) {
63
62
sanity_check_via_rustc_peek ( tcx, body, def_id, & attributes, & flow_inits) ;
64
63
}
64
+ if has_rustc_mir_with ( & attributes, sym:: stop_after_dataflow) . is_some ( ) {
65
+ tcx. sess . fatal ( "stop_after_dataflow ended compilation" ) ;
66
+ }
67
+
68
+ // FIXME: add these back as dataflow analyses are migrated
69
+ /*
65
70
if has_rustc_mir_with(&attributes, sym::rustc_peek_maybe_uninit).is_some() {
66
71
sanity_check_via_rustc_peek(tcx, body, def_id, &attributes, &flow_uninits);
67
72
}
@@ -71,9 +76,6 @@ impl<'tcx> MirPass<'tcx> for SanityCheck {
71
76
if has_rustc_mir_with(&attributes, sym::rustc_peek_indirectly_mutable).is_some() {
72
77
sanity_check_via_rustc_peek(tcx, body, def_id, &attributes, &flow_indirectly_mut);
73
78
}
74
- if has_rustc_mir_with(&attributes, sym::stop_after_dataflow).is_some() {
75
- tcx.sess.fatal("stop_after_dataflow ended compilation");
76
- }
77
79
*/
78
80
}
79
81
}
0 commit comments