Skip to content

Commit dd49c6f

Browse files
Document assumptions made in generator transform for analyses
The generator transform needs to inspect all possible dataflow states. This can be done with half the number of bitset union operations if we can assume that the relevant analyses do not use "before" effects.
1 parent def207e commit dd49c6f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: src/librustc_mir/dataflow/impls/borrowed_locals.rs

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ impl<K> GenKillAnalysis<'tcx> for MaybeBorrowedLocals<K>
9999
where
100100
K: BorrowAnalysisKind<'tcx>,
101101
{
102+
// The generator transform relies on the fact that this analysis does **not** use "before"
103+
// effects.
104+
102105
fn statement_effect(
103106
&self,
104107
trans: &mut impl GenKill<Self::Idx>,

Diff for: src/librustc_mir/dataflow/impls/init_locals.rs

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ impl dataflow::AnalysisDomain<'tcx> for MaybeInitializedLocals {
3333
}
3434

3535
impl dataflow::GenKillAnalysis<'tcx> for MaybeInitializedLocals {
36+
// The generator transform relies on the fact that this analysis does **not** use "before"
37+
// effects.
38+
3639
fn statement_effect(
3740
&self,
3841
trans: &mut impl GenKill<Self::Idx>,

0 commit comments

Comments
 (0)