[Dependency Scanning] Do not disambiguate 'GlobalModuleDependenciesCache' by search path set

This is no longer necessary since the cache is always configured for the current scanning context hash, which includes the search path set.
This commit is contained in:
Artem Chikin
2022-12-05 15:02:25 -08:00
parent 990b95e9d8
commit f39c6385df
8 changed files with 193 additions and 374 deletions

View File

@@ -120,7 +120,8 @@ DependencyScanningTool::getDependencies(
// Local scan cache instance, wrapping the shared global cache.
ModuleDependenciesCache cache(*SharedCache,
Instance->getMainModule()->getNameStr());
Instance->getMainModule()->getNameStr().str(),
Instance->getInvocation().getModuleScanningHash());
// Execute the scanning action, retrieving the in-memory result
auto DependenciesOrErr = performModuleScan(*Instance.get(), cache);
if (DependenciesOrErr.getError())
@@ -161,7 +162,8 @@ DependencyScanningTool::getDependencies(
// Local scan cache instance, wrapping the shared global cache.
ModuleDependenciesCache cache(*SharedCache,
Instance->getMainModule()->getNameStr());
Instance->getMainModule()->getNameStr().str(),
Instance->getInvocation().getModuleScanningHash());
auto BatchScanResults = performBatchModuleScan(
*Instance.get(), cache, VersionedPCMInstanceCacheCache.get(),
Saver, BatchInput);
@@ -205,8 +207,6 @@ DependencyScanningTool::initScannerForAction(
auto instanceOrErr = initCompilerInstanceForScan(Command);
if (instanceOrErr.getError())
return instanceOrErr;
SharedCache->configureForContextHash((*instanceOrErr)->getInvocation()
.getModuleScanningHash());
return instanceOrErr;
}