Skip to content

Commit 5efb81d

Browse files
committed
Move state transform after optimizations.
1 parent 2cea40a commit 5efb81d

47 files changed

Lines changed: 3307 additions & 4828 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/rustc_mir_transform/src/coroutine/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ const SELF_ARG: Local = Local::arg(0);
160160
pub(crate) const CTX_ARG: Local = Local::arg(1);
161161

162162
/// A `yield` point in the coroutine.
163+
#[derive(Debug)]
163164
struct SuspensionPoint<'tcx> {
164165
/// State discriminant used when suspending or resuming at this point.
165166
state: usize,

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,6 @@ fn run_runtime_lowering_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
647647
&add_moves_for_packed_drops::AddMovesForPackedDrops,
648648
&erase_deref_temps::EraseDerefTemps,
649649
&elaborate_box_derefs::ElaborateBoxDerefs,
650-
&coroutine::StateTransform,
651650
&Lint(known_panics_lint::KnownPanicsLint),
652651
];
653652
pm::run_passes_no_validate(tcx, body, passes, Some(MirPhase::Runtime(RuntimePhase::Initial)));
@@ -765,6 +764,7 @@ pub(crate) fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'
765764
&simplify::SimplifyLocals::Final,
766765
&multiple_return_terminators::MultipleReturnTerminators,
767766
&large_enums::EnumSizeOpt { discrepancy: 128 },
767+
&coroutine::StateTransform,
768768
// Some cleanup necessary at least for LLVM and potentially other codegen backends.
769769
&add_call_guards::CriticalCallEdges,
770770
// Cleanup for human readability, off by default.

compiler/rustc_mir_transform/src/shim.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceKind<'tcx>) -> Body<
115115
tcx,
116116
&mut body,
117117
&[
118-
&mentioned_items::MentionedItems,
119118
&abort_unwinding_calls::AbortUnwindingCalls,
120119
&add_call_guards::CriticalCallEdges,
121120
],

compiler/rustc_mir_transform/src/shim/async_destructor_ctor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ fn build_adrop_for_coroutine_shim<'tcx>(
207207
body.source.instance = instance;
208208
body.phase = MirPhase::Runtime(RuntimePhase::Initial);
209209
body.var_debug_info.clear();
210+
body.mentioned_items = None;
210211

211212
// converting `(_1: Pin<&mut CorLayout>, _2: &mut Context<'_>) -> Poll<()>`
212213
// into `(_1: Pin<&mut ProxyLayout>, _2: &mut Context<'_>) -> Poll<()>`

0 commit comments

Comments
 (0)