@@ -9,9 +9,9 @@ use super::{Analysis, Effect, EffectIndex, Results, SwitchIntTarget};
9
9
10
10
pub trait Direction {
11
11
const IS_FORWARD : bool ;
12
-
13
12
const IS_BACKWARD : bool = !Self :: IS_FORWARD ;
14
13
14
+ /// Called by `iterate_to_fixpoint` during initial analysis computation.
15
15
fn apply_effects_in_block < ' mir , ' tcx , A > (
16
16
analysis : & mut A ,
17
17
body : & mir:: Body < ' tcx > ,
@@ -22,7 +22,8 @@ pub trait Direction {
22
22
) where
23
23
A : Analysis < ' tcx > ;
24
24
25
- /// Applies all effects between the given `EffectIndex`s.
25
+ /// Called by `ResultsCursor` to recompute the domain value for a location
26
+ /// in a basic block. Applies all effects between the given `EffectIndex`s.
26
27
///
27
28
/// `effects.start()` must precede or equal `effects.end()` in this direction.
28
29
fn apply_effects_in_range < ' tcx , A > (
@@ -34,6 +35,9 @@ pub trait Direction {
34
35
) where
35
36
A : Analysis < ' tcx > ;
36
37
38
+ /// Called by `ResultsVisitor` to recompute the analysis domain values for
39
+ /// all locations in a basic block (starting from the entry value stored
40
+ /// in `Results`) and to visit them with `vis`.
37
41
fn visit_results_in_block < ' mir , ' tcx , A > (
38
42
state : & mut A :: Domain ,
39
43
block : BasicBlock ,
@@ -222,7 +226,6 @@ impl Direction for Backward {
222
226
223
227
vis. visit_block_end ( state) ;
224
228
225
- // Terminator
226
229
let loc = Location { block, statement_index : block_data. statements . len ( ) } ;
227
230
let term = block_data. terminator ( ) ;
228
231
results. analysis . apply_before_terminator_effect ( state, term, loc) ;
0 commit comments