diff options
Diffstat (limited to 'compiler/rustc_session/src/options.rs')
| -rw-r--r-- | compiler/rustc_session/src/options.rs | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 35819f896c5..8977365ee73 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1,5 +1,4 @@ use std::collections::BTreeMap; -use std::hash::{DefaultHasher, Hasher}; use std::num::{IntErrorKind, NonZero}; use std::path::PathBuf; use std::str; @@ -7,9 +6,10 @@ use std::str; use rustc_abi::Align; use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::profiling::TimePassesFormat; -use rustc_data_structures::stable_hasher::Hash64; +use rustc_data_structures::stable_hasher::StableHasher; use rustc_errors::{ColorConfig, LanguageIdentifier, TerminalUrl}; use rustc_feature::UnstableFeatures; +use rustc_hashes::Hash64; use rustc_macros::{Decodable, Encodable}; use rustc_span::edition::Edition; use rustc_span::{RealFileName, SourceFileHashAlgorithm}; @@ -251,7 +251,7 @@ macro_rules! top_level_options { } impl Options { - pub fn dep_tracking_hash(&self, for_crate_hash: bool) -> u64 { + pub fn dep_tracking_hash(&self, for_crate_hash: bool) -> Hash64 { let mut sub_hashes = BTreeMap::new(); $({ hash_opt!($opt, @@ -260,7 +260,7 @@ macro_rules! top_level_options { for_crate_hash, [$dep_tracking_marker]); })* - let mut hasher = DefaultHasher::new(); + let mut hasher = StableHasher::new(); dep_tracking::stable_hash(sub_hashes, &mut hasher, self.error_format, @@ -545,7 +545,7 @@ macro_rules! options { build_options(early_dcx, matches, target_modifiers, $stat, $prefix, $outputname) } - fn dep_tracking_hash(&self, for_crate_hash: bool, error_format: ErrorOutputType) -> u64 { + fn dep_tracking_hash(&self, for_crate_hash: bool, error_format: ErrorOutputType) -> Hash64 { let mut sub_hashes = BTreeMap::new(); $({ hash_opt!($opt, @@ -554,7 +554,7 @@ macro_rules! options { for_crate_hash, [$dep_tracking_marker]); })* - let mut hasher = DefaultHasher::new(); + let mut hasher = StableHasher::new(); dep_tracking::stable_hash(sub_hashes, &mut hasher, error_format, @@ -707,7 +707,7 @@ mod desc { pub(crate) const parse_list: &str = "a space-separated list of strings"; pub(crate) const parse_list_with_polarity: &str = "a comma-separated list of strings, with elements beginning with + or -"; - pub(crate) const parse_autodiff: &str = "a comma separated list of settings: `Print`, `PrintTA`, `PrintAA`, `PrintPerf`, `PrintModBefore`, `PrintModAfterOpts`, `PrintModAfterEnzyme`, `LooseTypes`, `NoModOptAfter`, `EnableFncOpt`, `NoVecUnroll`, `Inline`"; + pub(crate) const parse_autodiff: &str = "a comma separated list of settings: `Enable`, `PrintSteps`, `PrintTA`, `PrintAA`, `PrintPerf`, `PrintModBefore`, `PrintModAfter`, `LooseTypes`, `Inline`"; pub(crate) const parse_comma_list: &str = "a comma-separated list of strings"; pub(crate) const parse_opt_comma_list: &str = parse_comma_list; pub(crate) const parse_number: &str = "a number"; @@ -1348,17 +1348,14 @@ pub mod parse { v.sort_unstable(); for &val in v.iter() { let variant = match val { + "Enable" => AutoDiff::Enable, "PrintTA" => AutoDiff::PrintTA, "PrintAA" => AutoDiff::PrintAA, "PrintPerf" => AutoDiff::PrintPerf, - "Print" => AutoDiff::Print, + "PrintSteps" => AutoDiff::PrintSteps, "PrintModBefore" => AutoDiff::PrintModBefore, - "PrintModAfterOpts" => AutoDiff::PrintModAfterOpts, - "PrintModAfterEnzyme" => AutoDiff::PrintModAfterEnzyme, + "PrintModAfter" => AutoDiff::PrintModAfter, "LooseTypes" => AutoDiff::LooseTypes, - "NoModOptAfter" => AutoDiff::NoModOptAfter, - "EnableFncOpt" => AutoDiff::EnableFncOpt, - "NoVecUnroll" => AutoDiff::NoVecUnroll, "Inline" => AutoDiff::Inline, _ => { // FIXME(ZuseZ4): print an error saying which value is not recognized @@ -2081,21 +2078,19 @@ options! { assume_incomplete_release: bool = (false, parse_bool, [TRACKED], "make cfg(version) treat the current version as incomplete (default: no)"), autodiff: Vec<crate::config::AutoDiff> = (Vec::new(), parse_autodiff, [TRACKED], - "a list of optional autodiff flags to enable - Optional extra settings: - `=PrintTA` - `=PrintAA` - `=PrintPerf` - `=Print` - `=PrintModBefore` - `=PrintModAfterOpts` - `=PrintModAfterEnzyme` - `=LooseTypes` - `=NoModOptAfter` - `=EnableFncOpt` - `=NoVecUnroll` - `=Inline` - Multiple options can be combined with commas."), + "a list of autodiff flags to enable + Mandatory setting: + `=Enable` + Optional extra settings: + `=PrintTA` + `=PrintAA` + `=PrintPerf` + `=PrintSteps` + `=PrintModBefore` + `=PrintModAfter` + `=LooseTypes` + `=Inline` + Multiple options can be combined with commas."), #[rustc_lint_opt_deny_field_access("use `Session::binary_dep_depinfo` instead of this field")] binary_dep_depinfo: bool = (false, parse_bool, [TRACKED], "include artifacts (sysroot, crate dependencies) used during compilation in dep-info \ |
