Skip to content

Commit

Permalink
Document assumptions made in generator transform for analyses
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ecstatic-morse committed May 20, 2020
1 parent def207e commit dd49c6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librustc_mir/dataflow/impls/borrowed_locals.rs
Expand Up @@ -99,6 +99,9 @@ impl<K> GenKillAnalysis<'tcx> for MaybeBorrowedLocals<K>
where
K: BorrowAnalysisKind<'tcx>,
{
// The generator transform relies on the fact that this analysis does **not** use "before"
// effects.

fn statement_effect(
&self,
trans: &mut impl GenKill<Self::Idx>,
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_mir/dataflow/impls/init_locals.rs
Expand Up @@ -33,6 +33,9 @@ impl dataflow::AnalysisDomain<'tcx> for MaybeInitializedLocals {
}

impl dataflow::GenKillAnalysis<'tcx> for MaybeInitializedLocals {
// The generator transform relies on the fact that this analysis does **not** use "before"
// effects.

fn statement_effect(
&self,
trans: &mut impl GenKill<Self::Idx>,
Expand Down

0 comments on commit dd49c6f

Please sign in to comment.