Skip to content

Commit 591b024

Browse files
committed
[Dependency Scanning] Use a standalone DependencyScanningFilesystem on the scanner, sharing a common status cache from Clang's dependency service cache
1 parent ef07102 commit 591b024

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/DependencyScan/ModuleDependencyScanner.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ ModuleDependencyScanningWorker::ModuleDependencyScanningWorker(
153153
auto ClangModuleCachePath = getModuleCachePathFromClang(
154154
ScanASTContext.getClangModuleLoader()->getClangInstance());
155155
auto &FEOpts = ScanCompilerInvocation.getFrontendOptions();
156+
157+
// Configure the filesystem to use the same shared `stat` cache as the Clang
158+
// worker uses.
159+
auto DepFS =
160+
new clang::tooling::dependencies::DependencyScanningWorkerFilesystem(
161+
globalScanningService.ClangScanningService->getSharedCache(),
162+
ScanASTContext.SourceMgr.getFileSystem());
163+
ScanASTContext.SourceMgr.setFileSystem(DepFS);
164+
156165
ModuleInterfaceLoaderOptions LoaderOpts(FEOpts);
157166
ScanningASTDelegate = std::make_unique<InterfaceSubContextDelegateImpl>(
158167
ScanASTContext.SourceMgr, &ScanASTContext.Diags,

0 commit comments

Comments
 (0)