mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Consider '-swift-module-file' inputs when looking for dependencies
Previously this flag was only used to pass explicit dependencies to compilation tasks. This change adds support for the dependency scanner to also consider these inputs when resolving dependencies. Resolves https://github.com/swiftlang/swift-driver/issues/1951
This commit is contained in:
@@ -2246,11 +2246,10 @@ struct ExplicitSwiftModuleLoader::Implementation {
|
||||
}
|
||||
|
||||
void addCommandLineExplicitInputs(
|
||||
const std::vector<std::pair<std::string, std::string>>
|
||||
&commandLineExplicitInputs) {
|
||||
const llvm::StringMap<std::string> &commandLineExplicitInputs) {
|
||||
for (const auto &moduleInput : commandLineExplicitInputs) {
|
||||
ExplicitSwiftModuleInputInfo entry(moduleInput.second, {}, {}, {});
|
||||
ExplicitModuleMap.try_emplace(moduleInput.first, std::move(entry));
|
||||
ExplicitSwiftModuleInputInfo entry(moduleInput.getValue(), {}, {}, {});
|
||||
ExplicitModuleMap.try_emplace(moduleInput.first(), std::move(entry));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2422,7 +2421,7 @@ std::unique_ptr<ExplicitSwiftModuleLoader>
|
||||
ExplicitSwiftModuleLoader::create(ASTContext &ctx,
|
||||
DependencyTracker *tracker, ModuleLoadingMode loadMode,
|
||||
StringRef ExplicitSwiftModuleMap,
|
||||
const std::vector<std::pair<std::string, std::string>> &ExplicitSwiftModuleInputs,
|
||||
const llvm::StringMap<std::string> &ExplicitSwiftModuleInputs,
|
||||
bool IgnoreSwiftSourceInfoFile) {
|
||||
auto result = std::unique_ptr<ExplicitSwiftModuleLoader>(
|
||||
new ExplicitSwiftModuleLoader(ctx, tracker, loadMode,
|
||||
@@ -2536,11 +2535,10 @@ struct ExplicitCASModuleLoader::Implementation {
|
||||
}
|
||||
|
||||
void addCommandLineExplicitInputs(
|
||||
const std::vector<std::pair<std::string, std::string>>
|
||||
&commandLineExplicitInputs) {
|
||||
const llvm::StringMap<std::string> &commandLineExplicitInputs) {
|
||||
for (const auto &moduleInput : commandLineExplicitInputs) {
|
||||
ExplicitSwiftModuleInputInfo entry(moduleInput.second, {}, {}, {});
|
||||
ExplicitModuleMap.try_emplace(moduleInput.first, std::move(entry));
|
||||
ExplicitSwiftModuleInputInfo entry(moduleInput.getValue(), {}, {}, {});
|
||||
ExplicitModuleMap.try_emplace(moduleInput.getKey(), std::move(entry));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2777,8 +2775,7 @@ std::unique_ptr<ExplicitCASModuleLoader> ExplicitCASModuleLoader::create(
|
||||
ASTContext &ctx, llvm::cas::ObjectStore &CAS, llvm::cas::ActionCache &cache,
|
||||
DependencyTracker *tracker, ModuleLoadingMode loadMode,
|
||||
StringRef ExplicitSwiftModuleMap,
|
||||
const std::vector<std::pair<std::string, std::string>>
|
||||
&ExplicitSwiftModuleInputs,
|
||||
const llvm::StringMap<std::string> &ExplicitSwiftModuleInputs,
|
||||
bool IgnoreSwiftSourceInfoFile) {
|
||||
auto result =
|
||||
std::unique_ptr<ExplicitCASModuleLoader>(new ExplicitCASModuleLoader(
|
||||
|
||||
Reference in New Issue
Block a user