mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Modules] Avoid false swift module sharing
When the swiftmodule is built with different clang importer arguments, they can have the same module hash, causing them to be wrongly re-used even they contains different interfaces. Add ReducedExtraArgs to the module hash to disambiguate them. However, some Xcc arguments, most commonly `-D` options do not affect the swiftmodule being generated. Do not pass `-Xcc -DARGS` to swift interface compilation to reduce the amount of module variants in the build. rdar://131408266
This commit is contained in:
@@ -381,7 +381,8 @@ ModuleDependencyScanner::getMainModuleDependencyInfo(ModuleDecl *mainModule) {
|
||||
std::vector<std::string> buildArgs;
|
||||
if (ScanASTContext.ClangImporterOpts.ClangImporterDirectCC1Scan) {
|
||||
buildArgs.push_back("-direct-clang-cc1-module-build");
|
||||
for (auto &arg : clangImporter->getSwiftExplicitModuleDirectCC1Args()) {
|
||||
for (auto &arg : clangImporter->getSwiftExplicitModuleDirectCC1Args(
|
||||
/*isInterface=*/false)) {
|
||||
buildArgs.push_back("-Xcc");
|
||||
buildArgs.push_back(arg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user