diff options
Diffstat (limited to 'clang/unittests/Basic/FileManagerTest.cpp')
-rw-r--r-- | clang/unittests/Basic/FileManagerTest.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp index 866859a..c9dfbd6 100644 --- a/clang/unittests/Basic/FileManagerTest.cpp +++ b/clang/unittests/Basic/FileManagerTest.cpp @@ -26,7 +26,7 @@ class FakeStatCache : public FileSystemStatCache { private: // Maps a file/directory path to its desired stat result. Anything // not in this map is considered to not exist in the file system. - llvm::StringMap<FileData, llvm::BumpPtrAllocator> StatCalls; + llvm::StringMap<llvm::vfs::Status, llvm::BumpPtrAllocator> StatCalls; void InjectFileOrDirectory(const char *Path, ino_t INode, bool IsFile) { #ifndef _WIN32 @@ -35,15 +35,14 @@ private: Path = NormalizedPath.c_str(); #endif - FileData Data; - Data.Name = Path; - Data.Size = 0; - Data.ModTime = 0; - Data.UniqueID = llvm::sys::fs::UniqueID(1, INode); - Data.IsDirectory = !IsFile; - Data.IsNamedPipe = false; - Data.InPCH = false; - StatCalls[Path] = Data; + auto fileType = IsFile ? + llvm::sys::fs::file_type::regular_file : + llvm::sys::fs::file_type::directory_file; + llvm::vfs::Status Status(Path, llvm::sys::fs::UniqueID(1, INode), + /*MTime*/{}, /*User*/0, /*Group*/0, + /*Size*/0, fileType, + llvm::sys::fs::perms::all_all); + StatCalls[Path] = Status; } public: @@ -58,7 +57,7 @@ public: } // Implement FileSystemStatCache::getStat(). - LookupResult getStat(StringRef Path, FileData &Data, bool isFile, + LookupResult getStat(StringRef Path, llvm::vfs::Status &Status, bool isFile, std::unique_ptr<llvm::vfs::File> *F, llvm::vfs::FileSystem &FS) override { #ifndef _WIN32 @@ -68,7 +67,7 @@ public: #endif if (StatCalls.count(Path) != 0) { - Data = StatCalls[Path]; + Status = StatCalls[Path]; return CacheExists; } |