Dependencies Scanner: report compiled Swift module paths if they are available

For the explicit module mode, swift-driver uses -compile-module-from-interface to
generate modules from interfaces found by the dependency scanner. However, we don't
need to build the binary module if up-to-date modules are available, either adjacent
to the interface file or in the prebuilt module cache directory. This patch teaches
dependencies scanner to report these ready-to-use binary modules.
This commit is contained in:
Xi Ge
2020-06-30 12:36:54 -07:00
parent d2bf4473ae
commit 84dd4db0b1
13 changed files with 165 additions and 71 deletions

View File

@@ -200,6 +200,11 @@ public:
virtual Optional<ModuleDependencies> getModuleDependencies(
StringRef moduleName, ModuleDependenciesCache &cache,
InterfaceSubContextDelegate &delegate) override;
virtual std::string getUpToDateCompiledModuleForInterface(StringRef moduleName,
StringRef interfacePath) {
return std::string();
}
};
/// Imports serialized Swift modules into an ASTContext.