@@ -296,7 +296,7 @@ fn mir_const(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> &Steal<
296
296
& Lint ( check_const_item_mutation:: CheckConstItemMutation ) ,
297
297
& Lint ( function_item_references:: FunctionItemReferences ) ,
298
298
// What we need to do constant evaluation.
299
- & simplify:: SimplifyCfg :: new ( "initial" ) ,
299
+ & simplify:: SimplifyCfg :: Initial ,
300
300
& rustc_peek:: SanityCheck , // Just a lint
301
301
] ,
302
302
None ,
@@ -334,11 +334,7 @@ fn mir_promoted(
334
334
pm:: run_passes (
335
335
tcx,
336
336
& mut body,
337
- & [
338
- & promote_pass,
339
- & simplify:: SimplifyCfg :: new ( "promote-consts" ) ,
340
- & coverage:: InstrumentCoverage ,
341
- ] ,
337
+ & [ & promote_pass, & simplify:: SimplifyCfg :: PromoteConsts , & coverage:: InstrumentCoverage ] ,
342
338
Some ( MirPhase :: Analysis ( AnalysisPhase :: Initial ) ) ,
343
339
) ;
344
340
@@ -467,10 +463,7 @@ fn run_analysis_to_runtime_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>
467
463
pm:: run_passes (
468
464
tcx,
469
465
body,
470
- & [
471
- & remove_uninit_drops:: RemoveUninitDrops ,
472
- & simplify:: SimplifyCfg :: new ( "remove-false-edges" ) ,
473
- ] ,
466
+ & [ & remove_uninit_drops:: RemoveUninitDrops , & simplify:: SimplifyCfg :: RemoveFalseEdges ] ,
474
467
None ,
475
468
) ;
476
469
check_consts:: post_drop_elaboration:: check_live_drops ( tcx, & body) ; // FIXME: make this a MIR lint
@@ -492,7 +485,7 @@ fn run_analysis_cleanup_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
492
485
let passes: & [ & dyn MirPass < ' tcx > ] = & [
493
486
& cleanup_post_borrowck:: CleanupPostBorrowck ,
494
487
& remove_noop_landing_pads:: RemoveNoopLandingPads ,
495
- & simplify:: SimplifyCfg :: new ( "early-opt" ) ,
488
+ & simplify:: SimplifyCfg :: EarlyOpt ,
496
489
& deref_separator:: Derefer ,
497
490
] ;
498
491
@@ -525,7 +518,7 @@ fn run_runtime_lowering_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
525
518
/// Returns the sequence of passes that do the initial cleanup of runtime MIR.
526
519
fn run_runtime_cleanup_passes < ' tcx > ( tcx : TyCtxt < ' tcx > , body : & mut Body < ' tcx > ) {
527
520
let passes: & [ & dyn MirPass < ' tcx > ] =
528
- & [ & lower_intrinsics:: LowerIntrinsics , & simplify:: SimplifyCfg :: new ( "elaborate-drops" ) ] ;
521
+ & [ & lower_intrinsics:: LowerIntrinsics , & simplify:: SimplifyCfg :: ElaborateDrops ] ;
529
522
530
523
pm:: run_passes ( tcx, body, passes, Some ( MirPhase :: Runtime ( RuntimePhase :: PostCleanup ) ) ) ;
531
524
@@ -551,7 +544,7 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
551
544
& lower_slice_len:: LowerSliceLenCalls , // has to be done before inlining, otherwise actual call will be almost always inlined. Also simple, so can just do first
552
545
& unreachable_prop:: UnreachablePropagation ,
553
546
& uninhabited_enum_branching:: UninhabitedEnumBranching ,
554
- & o1 ( simplify:: SimplifyCfg :: new ( "after-uninhabited-enum-branching" ) ) ,
547
+ & o1 ( simplify:: SimplifyCfg :: AfterUninhabitedEnumBranching ) ,
555
548
& inline:: Inline ,
556
549
& remove_storage_markers:: RemoveStorageMarkers ,
557
550
& remove_zsts:: RemoveZsts ,
@@ -564,23 +557,23 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
564
557
& multiple_return_terminators:: MultipleReturnTerminators ,
565
558
& instcombine:: InstCombine ,
566
559
& separate_const_switch:: SeparateConstSwitch ,
567
- & simplify:: SimplifyLocals :: new ( "before-const-prop" ) ,
560
+ & simplify:: SimplifyLocals :: BeforeConstProp ,
568
561
& copy_prop:: CopyProp ,
569
562
& const_prop:: ConstProp ,
570
563
& dataflow_const_prop:: DataflowConstProp ,
571
564
//
572
565
// Const-prop runs unconditionally, but doesn't mutate the MIR at mir-opt-level=0.
573
566
& const_debuginfo:: ConstDebugInfo ,
574
- & o1 ( simplify_branches:: SimplifyConstCondition :: new ( "after-const-prop" ) ) ,
567
+ & o1 ( simplify_branches:: SimplifyConstConditionPassName :: AfterConstProp ) ,
575
568
& early_otherwise_branch:: EarlyOtherwiseBranch ,
576
569
& simplify_comparison_integral:: SimplifyComparisonIntegral ,
577
570
& dead_store_elimination:: DeadStoreElimination ,
578
571
& dest_prop:: DestinationPropagation ,
579
- & o1 ( simplify_branches:: SimplifyConstCondition :: new ( "final" ) ) ,
572
+ & o1 ( simplify_branches:: SimplifyConstConditionPassName :: Final ) ,
580
573
& o1 ( remove_noop_landing_pads:: RemoveNoopLandingPads ) ,
581
- & o1 ( simplify:: SimplifyCfg :: new ( "final" ) ) ,
574
+ & o1 ( simplify:: SimplifyCfg :: Final ) ,
582
575
& nrvo:: RenameReturnPlace ,
583
- & simplify:: SimplifyLocals :: new ( "final" ) ,
576
+ & simplify:: SimplifyLocals :: Final ,
584
577
& multiple_return_terminators:: MultipleReturnTerminators ,
585
578
& deduplicate_blocks:: DeduplicateBlocks ,
586
579
& large_enums:: EnumSizeOpt { discrepancy : 128 } ,
0 commit comments