rustc_mir: buffer -Zdump-mir output instead of pestering the kernel constantly.

This commit is contained in:
Eduard-Mihai Burtescu 2019-09-10 13:43:54 +03:00
parent 61dced1827
commit 1e7faef220

View file

@ -227,12 +227,12 @@ pub(crate) fn create_dump_file(
pass_name: &str,
disambiguator: &dyn Display,
source: MirSource<'tcx>,
) -> io::Result<fs::File> {
) -> io::Result<io::BufWriter<fs::File>> {
let file_path = dump_path(tcx, extension, pass_num, pass_name, disambiguator, source);
if let Some(parent) = file_path.parent() {
fs::create_dir_all(parent)?;
}
fs::File::create(&file_path)
Ok(io::BufWriter::new(fs::File::create(&file_path)?))
}
/// Write out a human-readable textual representation for the given MIR.