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
|
where
|
||||||
K: BorrowAnalysisKind<'tcx>,
|
K: BorrowAnalysisKind<'tcx>,
|
||||||
{
|
{
|
||||||
|
// The generator transform relies on the fact that this analysis does **not** use "before"
|
||||||
|
// effects.
|
||||||
|
|
||||||
fn statement_effect(
|
fn statement_effect(
|
||||||
&self,
|
&self,
|
||||||
trans: &mut impl GenKill<Self::Idx>,
|
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 {
|
impl dataflow::GenKillAnalysis<'tcx> for MaybeInitializedLocals {
|
||||||
|
// The generator transform relies on the fact that this analysis does **not** use "before"
|
||||||
|
// effects.
|
||||||
|
|
||||||
fn statement_effect(
|
fn statement_effect(
|
||||||
&self,
|
&self,
|
||||||
trans: &mut impl GenKill<Self::Idx>,
|
trans: &mut impl GenKill<Self::Idx>,
|
||||||
|
Loading…
Reference in New Issue
Block a user