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.
This commit is contained in:
Dylan MacKenzie 2020-05-13 09:42:56 -07:00
parent def207e262
commit dd49c6ffd1
2 changed files with 6 additions and 0 deletions

View File

@ -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>,

View File

@ -33,6 +33,9 @@ fn initialize_start_block(&self, body: &mir::Body<'tcx>, entry_set: &mut BitSet<
}
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>,