Skip to content

Commit

Permalink
Add an UnhashedFlag argument type for flags which should not affect…
Browse files Browse the repository at this point in the history
… the computed hash
  • Loading branch information
trxcllnt committed Oct 3, 2024
1 parent f9e064f commit 448c7d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/compiler/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ ArgData! { pub
PreprocessorArgument(OsString),
PreprocessorArgumentPath(PathBuf),
// Used for arguments that shouldn't affect the computed hash
UnhashedFlag,
Unhashed(OsString),
DoCompilation,
Output(PathBuf),
Expand Down Expand Up @@ -391,6 +392,7 @@ where
| Some(PreprocessorArgumentPath(_))
| Some(PassThrough(_))
| Some(PassThroughPath(_))
| Some(UnhashedFlag)
| Some(Unhashed(_)) => {}
Some(Language(lang)) => {
language = match lang.to_string_lossy().as_ref() {
Expand Down Expand Up @@ -450,7 +452,7 @@ where
| Some(PassThroughFlag)
| Some(PassThrough(_))
| Some(PassThroughPath(_)) => &mut common_args,
Some(Unhashed(_)) => &mut unhashed_args,
Some(UnhashedFlag) | Some(Unhashed(_)) => &mut unhashed_args,
Some(Arch(_)) => &mut arch_args,
Some(ExtraHashFile(path)) => {
extra_hash_files.push(cwd.join(path));
Expand Down Expand Up @@ -533,7 +535,7 @@ where
| Some(PassThroughFlag)
| Some(PassThroughPath(_))
| Some(SerializeDiagnostics(_)) => &mut common_args,
Some(Unhashed(_)) => &mut unhashed_args,
Some(UnhashedFlag) | Some(Unhashed(_)) => &mut unhashed_args,
Some(ExtraHashFile(path)) => {
extra_hash_files.push(cwd.join(path));
&mut common_args
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ pub fn parse_arguments(
| Some(PedanticFlag)
| Some(Standard(_))
| Some(SerializeDiagnostics(_)) => &mut common_args,
Some(Unhashed(_)) => &mut unhashed_args,
Some(UnhashedFlag) | Some(Unhashed(_)) => &mut unhashed_args,

Some(ProfileGenerate) => {
profile_generate = true;
Expand Down

0 comments on commit 448c7d9

Please sign in to comment.