Move the dataflow framework to its own crate.
This commit is contained in:
parent
81a600b6b7
commit
fd9c04fe32
74 changed files with 259 additions and 211 deletions
|
@ -5,9 +5,9 @@ use std::fmt;
|
|||
use std::fs::File;
|
||||
use std::io;
|
||||
|
||||
use crate::util as mir_util;
|
||||
use crate::MirPass;
|
||||
use rustc_middle::mir::Body;
|
||||
use rustc_middle::mir::{dump_enabled, dump_mir, write_mir_pretty};
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_session::config::{OutputFilenames, OutputType};
|
||||
|
||||
|
@ -39,21 +39,14 @@ pub fn on_mir_pass<'tcx>(
|
|||
body: &Body<'tcx>,
|
||||
is_after: bool,
|
||||
) {
|
||||
if mir_util::dump_enabled(tcx, pass_name, body.source.def_id()) {
|
||||
mir_util::dump_mir(
|
||||
tcx,
|
||||
Some(pass_num),
|
||||
pass_name,
|
||||
&Disambiguator { is_after },
|
||||
body,
|
||||
|_, _| Ok(()),
|
||||
);
|
||||
if dump_enabled(tcx, pass_name, body.source.def_id()) {
|
||||
dump_mir(tcx, Some(pass_num), pass_name, &Disambiguator { is_after }, body, |_, _| Ok(()));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn emit_mir(tcx: TyCtxt<'_>, outputs: &OutputFilenames) -> io::Result<()> {
|
||||
let path = outputs.path(OutputType::Mir);
|
||||
let mut f = io::BufWriter::new(File::create(&path)?);
|
||||
mir_util::write_mir_pretty(tcx, None, &mut f)?;
|
||||
write_mir_pretty(tcx, None, &mut f)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue