[6.2 🍒][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:
Artem Chikin
2025-07-09 16:58:43 -07:00
parent 61157cdd36
commit 89268e9b4d
15 changed files with 84 additions and 24 deletions

View File

@@ -2269,7 +2269,7 @@ static void ParseSymbolGraphArgs(symbolgraphgen::SymbolGraphOptions &Opts,
static bool validateSwiftModuleFileArgumentAndAdd(const std::string &swiftModuleArgument,
DiagnosticEngine &Diags,
std::vector<std::pair<std::string, std::string>> &ExplicitSwiftModuleInputs) {
llvm::StringMap<std::string> &ExplicitSwiftModuleInputs) {
std::size_t foundDelimeterPos = swiftModuleArgument.find_first_of("=");
if (foundDelimeterPos == std::string::npos) {
Diags.diagnose(SourceLoc(), diag::error_swift_module_file_requires_delimeter,
@@ -2282,7 +2282,7 @@ static bool validateSwiftModuleFileArgumentAndAdd(const std::string &swiftModule
Diags.diagnose(SourceLoc(), diag::error_bad_module_name, moduleName, false);
return true;
}
ExplicitSwiftModuleInputs.emplace_back(std::make_pair(moduleName, modulePath));
ExplicitSwiftModuleInputs.insert(std::make_pair(moduleName, modulePath));
return false;
}