mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Separate parsing out Swift and Clang modules from the explicit module map
Since https://github.com/apple/swift/pull/63178 added support for Clang modules in the explicit module map, it is possible for there to be multiple modules with the same name: a Swift module and a Clang module. The current parsing logic just overwrites the corresponding entry module in a hashmap so we always only preserved the module that comes last, with the same name. This change separates the parsing of the modulemap JSON file to produce a separate Swift module map and Clang module map. The Swift one is used by the 'ExplicitSwiftModuleLoader', as before, and the Clang one is only used to populate the ClangArgs with the requried -fmodule-... flags.
This commit is contained in:
@@ -83,8 +83,11 @@ bool PlaceholderSwiftModuleScanner::findModule(
|
||||
}
|
||||
auto &moduleInfo = it->getValue();
|
||||
auto dependencies = ModuleDependencyInfo::forPlaceholderSwiftModuleStub(
|
||||
moduleInfo.modulePath, moduleInfo.moduleDocPath,
|
||||
moduleInfo.moduleSourceInfoPath);
|
||||
moduleInfo.modulePath,
|
||||
moduleInfo.moduleDocPath.has_value() ?
|
||||
moduleInfo.moduleDocPath.value() : "",
|
||||
moduleInfo.moduleSourceInfoPath.has_value() ?
|
||||
moduleInfo.moduleSourceInfoPath.value() : "");
|
||||
this->dependencies = std::move(dependencies);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user