Github Remove dead code in `rustc_session::Options` by jyn514 · Pull Request #84...
source link: https://github.com/rust-lang/rust/pull/84802
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
New issue
Remove dead code in rustc_session::Options
#84802
Conversation
- Don't recompile the same functions for each debugging option
This reduces the amount of items in the crate by quite a lot. - Remove unused
parse_opt_list
andparse_pathbuf_push
functions - Remove unused macro parameters
- Remove
allow(dead_code)
.
(rust-highfive has picked a reviewer for you, use r? to override)
I expect this should help bootstrap time for rustc_session quite a bit (other crates shouldn't be affected).
@bors try @rust-timer queue
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
Trying commit 2828dec with merge 5ce9808b3b5bfb44d46efe3fe2d5d152fd51f39a...
Err ... I guess there's not a way to cancel an ongoing try run, and I don't know a way to tell rust-timer to queue a commit that isn't the latest.
@bors try @rust-timer queue
Awaiting bors try build completion.
@rustbot label: +S-waiting-on-perf
Trying commit b19c02c with merge a64224eaa14138ddc834a78d854d070df9154409...
Overall looks fine to me, presuming perf is happy.
pub const parse_wasi_exec_model: &str = "either `command` or `reactor`";
pub const parse_split_debuginfo: &str =
"one of supported split-debuginfo modes (`off` or `dsymutil`)";
&[ $( (stringify!($opt), crate::options::parse::$opt, $crate::options::desc::$parse, $desc) ),* ];
Mark-Simulacrum 6 days ago
Member
nit: one of these uses $crate, the other does not. Doesn't matter in practice as it's crate local (I think) but let's be consistent.
jyn514 6 days ago
Author
Member
Sure thing - I made this change locally, but I don't want to push since it will cancel the perf run.
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 735188768e4..cd28517bfbc 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -286,7 +286,7 @@ fn dep_tracking_hash(&self, _for_crate_hash: bool, error_format: ErrorOutputType pub type $setter_name = fn(&mut $struct_name, v: Option<&str>) -> bool; pub const $stat: &[(&str, $setter_name, &str, &str)] = - &[ $( (stringify!($opt), crate::options::parse::$opt, $crate::options::desc::$parse, $desc) ),* ]; + &[ $( (stringify!($opt), $crate::options::parse::$opt, $crate::options::desc::$parse, $desc) ),* ]; // Sometimes different options need to build a common structure. // That structure can kept in one of the options' fields, the others become dummy.
Try build successful - checks-actions
Build commit: a64224e (a64224eaa14138ddc834a78d854d070df9154409
)
Finished benchmarking try commit (a64224e): comparison url.
Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup-
to bors.
Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.
@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf
It looks like the time for rustc_session went ... up? the compiler should be doing strictly less work, maybe it's just noise?
Likely noise. Dead code doesn't usually influence performance too much as it's not generally codegen'd, and rustc itself is pretty fast. This still seems like an improvement overall to me, though, at least in terms of readability. @bors r+
Commit b19c02c has been approved by Mark-Simulacrum
Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 89ebad5 to master...
None yet
Successfully merging this pull request may close these issues.
None yet
Recommend
-
10
Pass around Symbols instead of Idents in doctree #79623
-
9
Collaborator rust-log-analyzer commented
-
15
Copy link Member jyn514 commented...
-
14
Copy link Member jyn514 commented
-
8
Copy link Member jyn514 commented...
-
2
rustc_metadata: Remove Span from ModChild #109772 ...
-
5
fix: remove extra argument "rustc" #14647 ...
-
2
Conversation Contributor...
-
3
Conversation Contributor...
-
3
Conversation
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK