16 #include "llvm/Support/Chrono.h" 17 #include "llvm/Support/ErrorOr.h" 18 #include "llvm/Support/Path.h" 21 using namespace clang;
23 void FileSystemStatCache::anchor() {}
47 std::unique_ptr<vfs::File> *F,
50 bool isForDir = !isFile;
54 R = Cache->
getStat(Path, Data, isFile, F, FS);
55 else if (isForDir || !F) {
58 llvm::ErrorOr<vfs::Status> Status = FS.
status(Path);
82 llvm::ErrorOr<vfs::Status> Status = (*OwnedFile)->status();
86 *F = std::move(*OwnedFile);
125 if (!Data.
IsDirectory || llvm::sys::path::is_absolute(Path))
126 StatCalls[Path] = Data;
Defines the FileSystemStatCache interface.
StringRef getName() const
Returns the name that should be used for this file or directory.
LookupResult statChained(StringRef Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, vfs::FileSystem &FS)
We know the file exists and its cached stat data.
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...
The result of a status operation.
static bool get(StringRef 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 LookupResult getStat(StringRef Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, vfs::FileSystem &FS)=0
static void copyStatusToFileData(const vfs::Status &Status, FileData &Data)
The result type of a method or function.
llvm::sys::fs::file_type getType() const
llvm::sys::fs::UniqueID UniqueID
llvm::sys::TimePoint getLastModificationTime() const
Dataflow Directional Tag Classes.
Defines the virtual file system interface vfs::FileSystem.
llvm::sys::fs::UniqueID getUniqueID() const
LookupResult getStat(StringRef Path, FileData &Data, bool isFile, std::unique_ptr< vfs::File > *F, vfs::FileSystem &FS) override