diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-23 09:41:33 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-23 18:49:58 +1100 |
| commit | f450bf49c033f534de22ac026fd10f035f1af3d0 (patch) | |
| tree | 7d2bd085ee33c27dbfb402d3a7cee7bca320e154 /compiler/rustc_mir_dataflow/src | |
| parent | a65e68a43bc9e71cad3c71ff826d820be7a44260 (diff) | |
Use `'mir` lifetime name more.
Some types have a `body: &'mir Body<'tcx>` and some have `body: &'a Body<'tcx>`. The former is more readable, so this commit converts some fo the latter to the former.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/direction.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/engine.rs | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/compiler/rustc_mir_dataflow/src/framework/direction.rs b/compiler/rustc_mir_dataflow/src/framework/direction.rs index 04c9f7a016c..08b7b1a2619 100644 --- a/compiler/rustc_mir_dataflow/src/framework/direction.rs +++ b/compiler/rustc_mir_dataflow/src/framework/direction.rs @@ -287,12 +287,12 @@ impl Direction for Backward { } } -struct BackwardSwitchIntEdgeEffectsApplier<'a, 'tcx, D, F> { - body: &'a mir::Body<'tcx>, +struct BackwardSwitchIntEdgeEffectsApplier<'mir, 'tcx, D, F> { + body: &'mir mir::Body<'tcx>, pred: BasicBlock, - exit_state: &'a mut D, + exit_state: &'mir mut D, bb: BasicBlock, - propagate: &'a mut F, + propagate: &'mir mut F, effects_applied: bool, } @@ -523,9 +523,9 @@ impl Direction for Forward { } } -struct ForwardSwitchIntEdgeEffectsApplier<'a, D, F> { - exit_state: &'a mut D, - targets: &'a SwitchTargets, +struct ForwardSwitchIntEdgeEffectsApplier<'mir, D, F> { + exit_state: &'mir mut D, + targets: &'mir SwitchTargets, propagate: F, effects_applied: bool, diff --git a/compiler/rustc_mir_dataflow/src/framework/engine.rs b/compiler/rustc_mir_dataflow/src/framework/engine.rs index ef7fe3a8e28..ed82b1e8cdc 100644 --- a/compiler/rustc_mir_dataflow/src/framework/engine.rs +++ b/compiler/rustc_mir_dataflow/src/framework/engine.rs @@ -128,12 +128,12 @@ where } /// A solver for dataflow problems. -pub struct Engine<'a, 'tcx, A> +pub struct Engine<'mir, 'tcx, A> where A: Analysis<'tcx>, { tcx: TyCtxt<'tcx>, - body: &'a mir::Body<'tcx>, + body: &'mir mir::Body<'tcx>, entry_sets: IndexVec<BasicBlock, A::Domain>, pass_name: Option<&'static str>, analysis: A, @@ -147,14 +147,14 @@ where apply_statement_trans_for_block: Option<Box<dyn Fn(BasicBlock, &mut A::Domain)>>, } -impl<'a, 'tcx, A, D, T> Engine<'a, 'tcx, A> +impl<'mir, 'tcx, A, D, T> Engine<'mir, 'tcx, A> where A: GenKillAnalysis<'tcx, Idx = T, Domain = D>, D: Clone + JoinSemiLattice + GenKill<T> + BitSetExt<T>, T: Idx, { /// Creates a new `Engine` to solve a gen-kill dataflow problem. - pub fn new_gen_kill(tcx: TyCtxt<'tcx>, body: &'a mir::Body<'tcx>, mut analysis: A) -> Self { + pub fn new_gen_kill(tcx: TyCtxt<'tcx>, body: &'mir mir::Body<'tcx>, mut analysis: A) -> Self { // If there are no back-edges in the control-flow graph, we only ever need to apply the // transfer function for each block exactly once (assuming that we process blocks in RPO). // @@ -186,7 +186,7 @@ where } } -impl<'a, 'tcx, A, D> Engine<'a, 'tcx, A> +impl<'mir, 'tcx, A, D> Engine<'mir, 'tcx, A> where A: Analysis<'tcx, Domain = D>, D: Clone + JoinSemiLattice, @@ -196,13 +196,13 @@ where /// /// Gen-kill problems should use `new_gen_kill`, which will coalesce transfer functions for /// better performance. - pub fn new_generic(tcx: TyCtxt<'tcx>, body: &'a mir::Body<'tcx>, analysis: A) -> Self { + pub fn new_generic(tcx: TyCtxt<'tcx>, body: &'mir mir::Body<'tcx>, analysis: A) -> Self { Self::new(tcx, body, analysis, None) } fn new( tcx: TyCtxt<'tcx>, - body: &'a mir::Body<'tcx>, + body: &'mir mir::Body<'tcx>, analysis: A, apply_statement_trans_for_block: Option<Box<dyn Fn(BasicBlock, &mut A::Domain)>>, ) -> Self { |
