Skip to content

Commit

Permalink
Update SimplifyCfg
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Nov 30, 2021
1 parent 7095aa6 commit 5a1227d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_mir_transform/src/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! naively generate still contains the `_a = ()` write in the unreachable block "after" the
//! return.
use crate::MirPass;
use crate::{MirPass, MirPassC};
use rustc_index::vec::{Idx, IndexVec};
use rustc_middle::mir::coverage::*;
use rustc_middle::mir::visit::{MutVisitor, MutatingUseContext, PlaceContext, Visitor};
Expand Down Expand Up @@ -55,6 +55,10 @@ pub fn simplify_cfg(tcx: TyCtxt<'tcx>, body: &mut Body<'_>) {
body.basic_blocks_mut().raw.shrink_to_fit();
}

impl MirPassC for SimplifyCfg {
const OPT_LEVEL: u32 = 0; // TODO: Only run if previous pass runs.
}

impl<'tcx> MirPass<'tcx> for SimplifyCfg {
fn name(&self) -> Cow<'_, str> {
Cow::Owned(format!("SimplifyCfg-{}", self.label))
Expand Down

0 comments on commit 5a1227d

Please sign in to comment.