mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Use a standalone DependencyScanningFilesystem on the scanner, sharing a common status cache from Clang's dependency service cache
This commit is contained in:
@@ -153,6 +153,17 @@ ModuleDependencyScanningWorker::ModuleDependencyScanningWorker(
|
||||
auto ClangModuleCachePath = getModuleCachePathFromClang(
|
||||
ScanASTContext.getClangModuleLoader()->getClangInstance());
|
||||
auto &FEOpts = ScanCompilerInvocation.getFrontendOptions();
|
||||
|
||||
// Configure the filesystem to use the same shared `stat` cache as the Clang
|
||||
// worker uses.
|
||||
if (!globalScanningService.CacheFS) {
|
||||
auto DepFS = llvm::makeIntrusiveRefCnt<
|
||||
clang::tooling::dependencies::DependencyScanningWorkerFilesystem>(
|
||||
globalScanningService.ClangScanningService->getSharedCache(),
|
||||
ScanASTContext.SourceMgr.getFileSystem());
|
||||
ScanASTContext.SourceMgr.setFileSystem(std::move(DepFS));
|
||||
}
|
||||
|
||||
ModuleInterfaceLoaderOptions LoaderOpts(FEOpts);
|
||||
ScanningASTDelegate = std::make_unique<InterfaceSubContextDelegateImpl>(
|
||||
ScanASTContext.SourceMgr, &ScanASTContext.Diags,
|
||||
|
||||
Reference in New Issue
Block a user