mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Dependency Scanning] Specify Explicit Module output path to the scanner explicitly
Instead of the code querying the compiler's built-in Clang instance, refactor the dependency scanner to explicitly keep track of module output path. It is still set according to '-module-cache-path' as it has been prior to this change, but now the scanner can use a different module cache for scanning PCMs, as specified with '-clang-scanner-module-cache-path', without affecting module output path. Resolves rdar://113222853
This commit is contained in:
@@ -174,7 +174,7 @@ void ClangImporter::recordModuleDependencies(
|
||||
|
||||
auto pcmPath = moduleCacheRelativeLookupModuleOutput(
|
||||
clangModuleDep.ID, ModuleOutputKind::ModuleFile,
|
||||
getModuleCachePathFromClang(getClangInstance()));
|
||||
cache.getModuleOutputPath());
|
||||
swiftArgs.push_back("-o");
|
||||
swiftArgs.push_back(pcmPath);
|
||||
|
||||
@@ -421,7 +421,7 @@ ClangImporter::getModuleDependencies(StringRef moduleName,
|
||||
}
|
||||
std::string workingDir = *optionalWorkingDir;
|
||||
|
||||
auto moduleCachePath = getModuleCachePathFromClang(getClangInstance());
|
||||
auto moduleCachePath = cache.getModuleOutputPath();
|
||||
auto lookupModuleOutput =
|
||||
[moduleCachePath](const ModuleID &MID,
|
||||
ModuleOutputKind MOK) -> std::string {
|
||||
|
||||
Reference in New Issue
Block a user