mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Revert "[Dependency Scanning] Use a standalone DependencyScanningFilesystemon the scanner, sharing a common status cache from Clang's dependency service cache"
This commit is contained in:
@@ -886,6 +886,11 @@ class SwiftDependencyScanningService {
|
||||
/// File prefix mapper.
|
||||
std::unique_ptr<llvm::TreePathPrefixMapper> Mapper;
|
||||
|
||||
/// The global file system cache.
|
||||
std::optional<
|
||||
clang::tooling::dependencies::DependencyScanningFilesystemSharedCache>
|
||||
SharedFilesystemCache;
|
||||
|
||||
/// A map from a String representing the target triple of a scanner invocation
|
||||
/// to the corresponding cached dependencies discovered so far when using this
|
||||
/// triple.
|
||||
@@ -914,6 +919,19 @@ public:
|
||||
operator=(const SwiftDependencyScanningService &) = delete;
|
||||
virtual ~SwiftDependencyScanningService() {}
|
||||
|
||||
/// Query the service's filesystem cache
|
||||
clang::tooling::dependencies::DependencyScanningFilesystemSharedCache &getSharedCache() {
|
||||
assert(SharedFilesystemCache && "Expected a shared cache");
|
||||
return *SharedFilesystemCache;
|
||||
}
|
||||
|
||||
/// Query the service's filesystem cache
|
||||
clang::tooling::dependencies::DependencyScanningFilesystemSharedCache &
|
||||
getSharedFilesystemCache() {
|
||||
assert(SharedFilesystemCache && "Expected a shared cache");
|
||||
return *SharedFilesystemCache;
|
||||
}
|
||||
|
||||
bool usingCachingFS() const { return !UseClangIncludeTree && (bool)CacheFS; }
|
||||
llvm::IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> getCachingFS() const { return CacheFS; }
|
||||
|
||||
|
||||
@@ -427,6 +427,7 @@ SwiftDependencyScanningService::SwiftDependencyScanningService() {
|
||||
/* CAS (llvm::cas::ObjectStore) */ nullptr,
|
||||
/* Cache (llvm::cas::ActionCache) */ nullptr,
|
||||
/* SharedFS */ nullptr);
|
||||
SharedFilesystemCache.emplace();
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -153,17 +153,6 @@ 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