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};
15
15
16
16
use super :: graphviz;
17
17
use super :: { Analysis , GenKillAnalysis , GenKillSet , Results } ;
18
+ use crate :: util:: pretty:: dump_enabled;
18
19
19
20
/// A solver for dataflow problems.
20
21
pub struct Engine < ' a , ' tcx , A >
@@ -400,12 +401,25 @@ where
400
401
let attrs = match RustcMirAttrs :: parse ( tcx, def_id) {
401
402
Ok ( attrs) => attrs,
402
403
403
- // Invalid `rustc_mir` attrs will be reported using `span_err`.
404
+ // Invalid `rustc_mir` attrs are reported in `RustcMirAttrs::parse`
404
405
Err ( ( ) ) => return Ok ( ( ) ) ,
405
406
} ;
406
407
407
408
let path = match attrs. output_path ( A :: NAME ) {
408
409
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
+
409
423
None => return Ok ( ( ) ) ,
410
424
} ;
411
425
You can’t perform that action at this time.
0 commit comments