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:
parent
def207e262
commit
dd49c6ffd1
@ -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>,
|
||||
|
@ -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>,
|
||||
|
Loading…
Reference in New Issue
Block a user