Skip to content

Commit 9395e27

Browse files
committed
make mir dataflow graphviz dumps opt-in
1 parent 3ed2a10 commit 9395e27

File tree

1 file changed

+7
-7
lines changed
  • compiler/rustc_mir_dataflow/src/framework

1 file changed

+7
-7
lines changed

compiler/rustc_mir_dataflow/src/framework/engine.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,11 @@ where
287287

288288
let mut results = Results { analysis, entry_sets, _marker: PhantomData };
289289

290-
let res = write_graphviz_results(tcx, body, &mut results, pass_name);
291-
if let Err(e) = res {
292-
error!("Failed to write graphviz dataflow results: {}", e);
290+
if tcx.sess.opts.unstable_opts.dump_mir_dataflow {
291+
let res = write_graphviz_results(tcx, &body, &mut results, pass_name);
292+
if let Err(e) = res {
293+
error!("Failed to write graphviz dataflow results: {}", e);
294+
}
293295
}
294296

295297
results
@@ -299,7 +301,7 @@ where
299301
// Graphviz
300302

301303
/// Writes a DOT file containing the results of a dataflow analysis if the user requested it via
302-
/// `rustc_mir` attributes.
304+
/// `rustc_mir` attributes and `-Z dump-mir-dataflow`.
303305
fn write_graphviz_results<'tcx, A>(
304306
tcx: TyCtxt<'tcx>,
305307
body: &mir::Body<'tcx>,
@@ -328,9 +330,7 @@ where
328330
io::BufWriter::new(fs::File::create(&path)?)
329331
}
330332

331-
None if tcx.sess.opts.unstable_opts.dump_mir_dataflow
332-
&& dump_enabled(tcx, A::NAME, def_id) =>
333-
{
333+
None if dump_enabled(tcx, A::NAME, def_id) => {
334334
create_dump_file(tcx, ".dot", false, A::NAME, &pass_name.unwrap_or("-----"), body)?
335335
}
336336

0 commit comments

Comments
 (0)