File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/librustc_mir/dataflow Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -446,9 +446,28 @@ pub struct AllSets<E: Idx> {
446
446
on_entry_sets : Bits < E > ,
447
447
}
448
448
449
+ /// Triple of sets associated with a given block.
450
+ ///
451
+ /// Generally, one sets up `on_entry`, `gen_set`, and `kill_set` for
452
+ /// each block individually, and then runs the dataflow analysis which
453
+ /// iteratively modifies the various `on_entry` sets (but leaves the
454
+ /// other two sets unchanged, since they represent the effect of the
455
+ /// block, which should be invariant over the course of the analysis).
456
+ ///
457
+ /// It is best to ensure that the intersection of `gen_set` and
458
+ /// `kill_set` is empty; otherwise the results of the dataflow will
459
+ /// have a hidden dependency on what order the bits are generated and
460
+ /// killed during the iteration. (This is such a good idea that the
461
+ /// `fn gen` and `fn kill` methods that set their state enforce this
462
+ /// for you.)
449
463
pub struct BlockSets < ' a , E : Idx > {
464
+ /// Dataflow state immediately before control flow enters the given block.
450
465
pub ( crate ) on_entry : & ' a mut IdxSet < E > ,
466
+
467
+ /// Bits that are set to 1 by the time we exit the given block.
451
468
pub ( crate ) gen_set : & ' a mut IdxSet < E > ,
469
+
470
+ /// Bits that are set to 0 by the time we exit the given block.
452
471
pub ( crate ) kill_set : & ' a mut IdxSet < E > ,
453
472
}
454
473
You can’t perform that action at this time.
0 commit comments