File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/librustc_mir/dataflow/framework Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ use rustc_span::symbol::{sym, Symbol};
1515
1616use super :: graphviz;
1717use super :: { Analysis , GenKillAnalysis , GenKillSet , Results } ;
18+ use crate :: util:: pretty:: dump_enabled;
1819
1920/// A solver for dataflow problems.
2021pub struct Engine < ' a , ' tcx , A >
@@ -400,12 +401,25 @@ where
400401 let attrs = match RustcMirAttrs :: parse ( tcx, def_id) {
401402 Ok ( attrs) => attrs,
402403
403- // Invalid `rustc_mir` attrs will be reported using `span_err`.
404+ // Invalid `rustc_mir` attrs are reported in `RustcMirAttrs::parse`
404405 Err ( ( ) ) => return Ok ( ( ) ) ,
405406 } ;
406407
407408 let path = match attrs. output_path ( A :: NAME ) {
408409 Some ( path) => path,
410+
411+ None if tcx. sess . opts . debugging_opts . dump_mir_dataflow
412+ && dump_enabled ( tcx, A :: NAME , def_id) =>
413+ {
414+ let mut path = PathBuf :: from ( & tcx. sess . opts . debugging_opts . dump_mir_dir ) ;
415+
416+ let item_name = ty:: print:: with_forced_impl_filename_line ( || {
417+ tcx. def_path ( def_id) . to_filename_friendly_no_crate ( )
418+ } ) ;
419+ path. push ( format ! ( "rustc.{}.{}.dot" , item_name, A :: NAME ) ) ;
420+ path
421+ }
422+
409423 None => return Ok ( ( ) ) ,
410424 } ;
411425
You can’t perform that action at this time.
0 commit comments