[CAS] Update swift CAS file system usage after llvm-project change

Update swift compiler to go with llvm CAS update to decouple CAS file
system from VFS that breaks layering violation.
This commit is contained in:
Steven Wu
2025-10-16 10:12:00 -07:00
parent 1ae8ef0004
commit 1beef99ba1
5 changed files with 28 additions and 22 deletions

View File

@@ -17,6 +17,7 @@
#include "swift/Serialization/ScanningLoaders.h"
#include "clang/Tooling/DependencyScanning/DependencyScanningTool.h"
#include "llvm/CAS/CASReference.h"
#include "llvm/CAS/CASFileSystem.h"
#include "llvm/Support/ThreadPool.h"
namespace swift {
@@ -249,7 +250,7 @@ public:
return *CAS;
}
llvm::vfs::FileSystem &getSharedCachingFS() const {
llvm::cas::CASBackedFileSystem &getSharedCachingFS() const {
assert(CacheFS && "Expect CacheFS available");
return *CacheFS;
}
@@ -358,7 +359,7 @@ private:
/// File prefix mapper.
std::unique_ptr<llvm::PrefixMapper> PrefixMapper;
/// CAS file system for loading file content.
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> CacheFS;
llvm::IntrusiveRefCntPtr<llvm::cas::CASBackedFileSystem> CacheFS;
/// Protect worker access.
std::mutex WorkersLock;
/// Count of filesystem queries performed