16 #include "llvm/Support/Path.h"
18 using namespace clang;
20 void FileSystemStatCache::anchor() { }
44 std::unique_ptr<vfs::File> *F,
47 bool isForDir = !isFile;
51 R = Cache->
getStat(Path, Data, isFile, F, FS);
52 else if (isForDir || !F) {
55 llvm::ErrorOr<vfs::Status> Status = FS.
status(Path);
79 llvm::ErrorOr<vfs::Status> Status = (*OwnedFile)->status();
83 *F = std::move(*OwnedFile);
122 if (!Data.
IsDirectory || llvm::sys::path::is_absolute(Path))
Defines the FileSystemStatCache interface.
llvm::sys::TimeValue getLastModificationTime() const
We know the file exists and its cached stat data.
static bool get(const char *Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, FileSystemStatCache *Cache, vfs::FileSystem &FS)
Get the 'stat' information for the specified path, using the cache to accelerate it if possible...
virtual llvm::ErrorOr< std::unique_ptr< File > > openFileForRead(const Twine &Path)=0
Get a File object for the file at Path, if one exists.
We know that the file doesn't exist.
The virtual file system interface.
virtual llvm::ErrorOr< Status > status(const Twine &Path)=0
Get the status of the entry at Path, if one exists.
Abstract interface for introducing a FileManager cache for 'stat' system calls, which is used by prec...
llvm::sys::fs::file_type getType() const
The result of a status operation.
virtual LookupResult getStat(const char *Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, vfs::FileSystem &FS)=0
llvm::StringMap< FileData, llvm::BumpPtrAllocator > StatCalls
The set of stat() calls that have been seen.
llvm::sys::fs::UniqueID getUniqueID() const
static void copyStatusToFileData(const vfs::Status &Status, FileData &Data)
The result type of a method or function.
llvm::sys::fs::UniqueID UniqueID
LookupResult statChained(const char *Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, vfs::FileSystem &FS)
Defines the virtual file system interface vfs::FileSystem.
StringRef getName() const
Returns the name that should be used for this file or directory.
LookupResult getStat(const char *Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, vfs::FileSystem &FS) override