Rollup merge of #110657 - miguelraz:cleanup-simplifycfg-refactor, r=compiler-errors
nit: consistent naming for SimplifyConstCondition Fixing a small naming inconsistency that `@JakobDegen` brought up in https://github.com/rust-lang/rust/pull/110477#discussion_r1170783823. Please signal for rollup.
This commit is contained in:
commit
617ecd2a7a
@ -507,12 +507,12 @@ fn o1<T>(x: T) -> WithMinOptLevel<T> {
|
||||
//
|
||||
// Const-prop runs unconditionally, but doesn't mutate the MIR at mir-opt-level=0.
|
||||
&const_debuginfo::ConstDebugInfo,
|
||||
&o1(simplify_branches::SimplifyConstConditionPassName::AfterConstProp),
|
||||
&o1(simplify_branches::SimplifyConstCondition::AfterConstProp),
|
||||
&early_otherwise_branch::EarlyOtherwiseBranch,
|
||||
&simplify_comparison_integral::SimplifyComparisonIntegral,
|
||||
&dead_store_elimination::DeadStoreElimination,
|
||||
&dest_prop::DestinationPropagation,
|
||||
&o1(simplify_branches::SimplifyConstConditionPassName::Final),
|
||||
&o1(simplify_branches::SimplifyConstCondition::Final),
|
||||
&o1(remove_noop_landing_pads::RemoveNoopLandingPads),
|
||||
&o1(simplify::SimplifyCfg::Final),
|
||||
&nrvo::RenameReturnPlace,
|
||||
|
@ -2,18 +2,16 @@
|
||||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
|
||||
pub enum SimplifyConstConditionPassName {
|
||||
pub enum SimplifyConstCondition {
|
||||
AfterConstProp,
|
||||
Final,
|
||||
}
|
||||
/// A pass that replaces a branch with a goto when its condition is known.
|
||||
impl<'tcx> MirPass<'tcx> for SimplifyConstConditionPassName {
|
||||
impl<'tcx> MirPass<'tcx> for SimplifyConstCondition {
|
||||
fn name(&self) -> &'static str {
|
||||
match self {
|
||||
SimplifyConstConditionPassName::AfterConstProp => {
|
||||
"SimplifyConstCondition-after-const-prop"
|
||||
}
|
||||
SimplifyConstConditionPassName::Final => "SimplifyConstCondition-final",
|
||||
SimplifyConstCondition::AfterConstProp => "SimplifyConstCondition-after-const-prop",
|
||||
SimplifyConstCondition::Final => "SimplifyConstCondition-final",
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user