[ExplicitModule] Include -Xcc -D into module hash

The decision to exclude `-Xcc -D` options from swift module hash
actually doesn't help to solve the problem. It wouldn't reduce the
module variants (or the number of swiftmodule build commands) because
the command-line also encodes all the clang PCM dependencies that do get
affected by `-Xcc` flags.

To avoid the false sharing and the nondeterministic build products,
include most of the `-Xcc` flags, except include search path, into swift
module hash.

rdar://132046247
This commit is contained in:
Steven Wu
2024-07-18 16:15:53 -07:00
parent cbb9b80378
commit 2bc4080116
6 changed files with 10 additions and 22 deletions

View File

@@ -729,7 +729,7 @@ namespace {
"-working-directory=",
"-working-directory"};
constexpr std::array<std::string_view, 16>
constexpr std::array<std::string_view, 15>
knownClangDependencyIgnorablePrefiexes = {"-I",
"-F",
"-fmodule-map-file=",
@@ -744,8 +744,7 @@ namespace {
"-isystem",
"-isysroot",
"-working-directory=",
"-working-directory",
"-D"};
"-working-directory"};
}
std::vector<std::string> ClangImporterOptions::getRemappedExtraArgs(