[Dependency Scanning] Restrict Swift overlay lookup to "visible" Clang modules only

Previously Swift overlay lookup was performed for every directly and transitively-imported Clang module.

https://github.com/llvm/llvm-project/pull/147969 introduced the concept of "visible" Clang modules from a given named Clang dependency scanner query which closely maps to the set of modules for which Swift will attempt to load a Swift overlay. This change switches overlay querying to apply only to the set of such visible modules.

Resolves rdar://144797648
This commit is contained in:
Artem Chikin
2025-07-11 16:59:34 -07:00
parent 23678690b2
commit 242585dcba
6 changed files with 197 additions and 82 deletions

View File

@@ -40,7 +40,7 @@ public:
private:
/// Retrieve the module dependencies for the Clang module with the given name.
ModuleDependencyVector scanFilesystemForClangModuleDependency(
ClangModuleScannerQueryResult scanFilesystemForClangModuleDependency(
Identifier moduleName,
const llvm::DenseSet<clang::tooling::dependencies::ModuleID>
&alreadySeenModules);
@@ -72,6 +72,7 @@ private:
ModuleDependencyIDSetVector &headerClangModuleDependencies,
std::vector<std::string> &headerFileInputs,
std::vector<std::string> &bridgingHeaderCommandLine,
std::vector<std::string> &visibleClangModules,
std::optional<std::string> &includeTreeID);