Skip to content

Remove -Zdump-mir-spanview #119566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ use rustc_session::config::{
build_configuration, build_session_options, rustc_optgroups, BranchProtection, CFGuard, Cfg,
DebugInfo, DumpMonoStatsFormat, ErrorOutputType, ExternEntry, ExternLocation, Externs,
FunctionReturn, InliningThreshold, Input, InstrumentCoverage, InstrumentXRay,
LinkSelfContained, LinkerPluginLto, LocationDetail, LtoCli, MirSpanview, NextSolverConfig,
OomStrategy, Options, OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, Passes, Polonius,
LinkSelfContained, LinkerPluginLto, LocationDetail, LtoCli, NextSolverConfig, OomStrategy,
Options, OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, Passes, Polonius,
ProcMacroExecutionStrategy, Strip, SwitchWithOptPath, SymbolManglingVersion, WasiExecModel,
};
use rustc_session::lint::Level;
@@ -666,7 +666,6 @@ fn test_unstable_options_tracking_hash() {
untracked!(dump_mir_dir, String::from("abc"));
untracked!(dump_mir_exclude_pass_number, true);
untracked!(dump_mir_graphviz, true);
untracked!(dump_mir_spanview, Some(MirSpanview::Statement));
untracked!(dump_mono_stats, SwitchWithOptPath::Enabled(Some("mono-items-dir/".into())));
untracked!(dump_mono_stats_format, DumpMonoStatsFormat::Json);
untracked!(dylib_lto, true);
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
@@ -55,7 +55,6 @@ pub mod mono;
pub mod patch;
pub mod pretty;
mod query;
pub mod spanview;
mod statement;
mod syntax;
pub mod tcx;
11 changes: 0 additions & 11 deletions compiler/rustc_middle/src/mir/pretty.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ use std::io::{self, Write as _};
use std::path::{Path, PathBuf};

use super::graphviz::write_mir_fn_graphviz;
use super::spanview::write_mir_fn_spanview;
use rustc_ast::InlineAsmTemplatePiece;
use rustc_middle::mir::interpret::{
alloc_range, read_target_uint, AllocBytes, AllocId, Allocation, GlobalAlloc, Pointer,
@@ -141,16 +140,6 @@ fn dump_matched_mir_node<'tcx, F>(
write_mir_fn_graphviz(tcx, body, false, &mut file)?;
};
}

if let Some(spanview) = tcx.sess.opts.unstable_opts.dump_mir_spanview {
let _: io::Result<()> = try {
let file_basename = dump_file_basename(tcx, pass_num, pass_name, disambiguator, body);
let mut file = create_dump_file_with_basename(tcx, &file_basename, "html")?;
if body.source.def_id().is_local() {
write_mir_fn_spanview(tcx, body, spanview, &file_basename, &mut file)?;
}
};
}
}

/// Returns the file basename portion (without extension) of a filename path
642 changes: 0 additions & 642 deletions compiler/rustc_middle/src/mir/spanview.rs

This file was deleted.

15 changes: 0 additions & 15 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
@@ -125,21 +125,6 @@ pub enum LtoCli {
Unspecified,
}

/// The different settings that the `-Z dump_mir_spanview` flag can have. `Statement` generates a
/// document highlighting each span of every statement (including terminators). `Terminator` and
/// `Block` highlight a single span per `BasicBlock`: the span of the block's `Terminator`, or a
/// computed span for the block, representing the entire range, covering the block's terminator and
/// all of its statements.
#[derive(Clone, Copy, PartialEq, Hash, Debug)]
pub enum MirSpanview {
/// Default `-Z dump_mir_spanview` or `-Z dump_mir_spanview=statement`
Statement,
/// `-Z dump_mir_spanview=terminator`
Terminator,
/// `-Z dump_mir_spanview=block`
Block,
}

/// The different settings that the `-C instrument-coverage` flag can have.
///
/// Coverage instrumentation now supports combining `-C instrument-coverage`
29 changes: 0 additions & 29 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
@@ -391,7 +391,6 @@ mod desc {
pub const parse_strip: &str = "either `none`, `debuginfo`, or `symbols`";
pub const parse_linker_flavor: &str = ::rustc_target::spec::LinkerFlavorCli::one_of();
pub const parse_optimization_fuel: &str = "crate=integer";
pub const parse_mir_spanview: &str = "`statement` (default), `terminator`, or `block`";
pub const parse_dump_mono_stats: &str = "`markdown` (default) or `json`";
pub const parse_instrument_coverage: &str =
"`all` (default), `branch`, `except-unused-generics`, `except-unused-functions`, or `off`";
@@ -866,29 +865,6 @@ mod parse {
}
}

pub(crate) fn parse_mir_spanview(slot: &mut Option<MirSpanview>, v: Option<&str>) -> bool {
if v.is_some() {
let mut bool_arg = None;
if parse_opt_bool(&mut bool_arg, v) {
*slot = bool_arg.unwrap().then_some(MirSpanview::Statement);
return true;
}
}

let Some(v) = v else {
*slot = Some(MirSpanview::Statement);
return true;
};

*slot = Some(match v.trim_end_matches('s') {
"statement" | "stmt" => MirSpanview::Statement,
"terminator" | "term" => MirSpanview::Terminator,
"block" | "basicblock" => MirSpanview::Block,
_ => return false,
});
true
}

pub(crate) fn parse_time_passes_format(slot: &mut TimePassesFormat, v: Option<&str>) -> bool {
match v {
None => true,
@@ -1601,11 +1577,6 @@ options! {
"exclude the pass number when dumping MIR (used in tests) (default: no)"),
dump_mir_graphviz: bool = (false, parse_bool, [UNTRACKED],
"in addition to `.mir` files, create graphviz `.dot` files (default: no)"),
dump_mir_spanview: Option<MirSpanview> = (None, parse_mir_spanview, [UNTRACKED],
"in addition to `.mir` files, create `.html` files to view spans for \
all `statement`s (including terminators), only `terminator` spans, or \
computed `block` spans (one span encompassing a block's terminator and \
all statements)."),
dump_mono_stats: SwitchWithOptPath = (SwitchWithOptPath::Disabled,
parse_switch_with_opt_path, [UNTRACKED],
"output statistics about monomorphization collection"),
67 changes: 0 additions & 67 deletions tests/mir-opt/spanview_block.main.built.after.html

This file was deleted.

6 changes: 0 additions & 6 deletions tests/mir-opt/spanview_block.rs

This file was deleted.

67 changes: 0 additions & 67 deletions tests/mir-opt/spanview_statement.main.built.after.html

This file was deleted.

6 changes: 0 additions & 6 deletions tests/mir-opt/spanview_statement.rs

This file was deleted.

66 changes: 0 additions & 66 deletions tests/mir-opt/spanview_terminator.main.built.after.html

This file was deleted.

6 changes: 0 additions & 6 deletions tests/mir-opt/spanview_terminator.rs

This file was deleted.