@@ -9,9 +9,9 @@ use super::{Analysis, Effect, EffectIndex, Results, SwitchIntTarget};
99
1010pub trait Direction {
1111 const IS_FORWARD : bool ;
12-
1312 const IS_BACKWARD : bool = !Self :: IS_FORWARD ;
1413
14+ /// Called by `iterate_to_fixpoint` during initial analysis computation.
1515 fn apply_effects_in_block < ' mir , ' tcx , A > (
1616 analysis : & mut A ,
1717 body : & mir:: Body < ' tcx > ,
@@ -22,7 +22,8 @@ pub trait Direction {
2222 ) where
2323 A : Analysis < ' tcx > ;
2424
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.
2627 ///
2728 /// `effects.start()` must precede or equal `effects.end()` in this direction.
2829 fn apply_effects_in_range < ' tcx , A > (
@@ -34,6 +35,9 @@ pub trait Direction {
3435 ) where
3536 A : Analysis < ' tcx > ;
3637
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`.
3741 fn visit_results_in_block < ' mir , ' tcx , A > (
3842 state : & mut A :: Domain ,
3943 block : BasicBlock ,
@@ -222,7 +226,6 @@ impl Direction for Backward {
222226
223227 vis. visit_block_end ( state) ;
224228
225- // Terminator
226229 let loc = Location { block, statement_index : block_data. statements . len ( ) } ;
227230 let term = block_data. terminator ( ) ;
228231 results. analysis . apply_before_terminator_effect ( state, term, loc) ;
0 commit comments