mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -131,9 +131,10 @@ DependencyScanningTool::getDependencies(
|
||||
auto Instance = std::move(*InstanceOrErr);
|
||||
|
||||
// Local scan cache instance, wrapping the shared global cache.
|
||||
ModuleDependenciesCache cache(*ScanningService,
|
||||
Instance->getMainModule()->getNameStr().str(),
|
||||
Instance->getInvocation().getModuleScanningHash());
|
||||
ModuleDependenciesCache cache(
|
||||
*ScanningService, Instance->getMainModule()->getNameStr().str(),
|
||||
Instance->getInvocation().getFrontendOptions().ExplicitModulesOutputPath,
|
||||
Instance->getInvocation().getModuleScanningHash());
|
||||
// Execute the scanning action, retrieving the in-memory result
|
||||
auto DependenciesOrErr = performModuleScan(*Instance.get(), cache);
|
||||
if (DependenciesOrErr.getError())
|
||||
@@ -173,9 +174,10 @@ DependencyScanningTool::getDependencies(
|
||||
auto Instance = std::move(*InstanceOrErr);
|
||||
|
||||
// Local scan cache instance, wrapping the shared global cache.
|
||||
ModuleDependenciesCache cache(*ScanningService,
|
||||
Instance->getMainModule()->getNameStr().str(),
|
||||
Instance->getInvocation().getModuleScanningHash());
|
||||
ModuleDependenciesCache cache(
|
||||
*ScanningService, Instance->getMainModule()->getNameStr().str(),
|
||||
Instance->getInvocation().getFrontendOptions().ExplicitModulesOutputPath,
|
||||
Instance->getInvocation().getModuleScanningHash());
|
||||
auto BatchScanResults = performBatchModuleScan(
|
||||
*Instance.get(), cache, VersionedPCMInstanceCacheCache.get(),
|
||||
Saver, BatchInput);
|
||||
|
||||
Reference in New Issue
Block a user