[PATCH] D60786: [FileSystemStatCache] Update test for new FileSystemStatCache API
This revision was automatically updated to reflect the committed changes. Closed by commit rC358511: [FileSystemStatCache] Update test for new FileSystemStatCache API (authored by harlanhaskins, committed by ). Changed prior to commit: https://reviews.llvm.org/D60786?vs=195416=195417#toc Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60786/new/ https://reviews.llvm.org/D60786 Files: unittests/Basic/FileManagerTest.cpp Index: unittests/Basic/FileManagerTest.cpp === --- unittests/Basic/FileManagerTest.cpp +++ unittests/Basic/FileManagerTest.cpp @@ -57,9 +57,10 @@ } // Implement FileSystemStatCache::getStat(). - LookupResult getStat(StringRef Path, llvm::vfs::Status , bool isFile, - std::unique_ptr *F, - llvm::vfs::FileSystem ) override { + std::error_code getStat(StringRef Path, llvm::vfs::Status , + bool isFile, + std::unique_ptr *F, + llvm::vfs::FileSystem ) override { #ifndef _WIN32 SmallString<128> NormalizedPath(Path); llvm::sys::path::native(NormalizedPath); @@ -68,10 +69,10 @@ if (StatCalls.count(Path) != 0) { Status = StatCalls[Path]; - return CacheExists; + return std::error_code(); } -return CacheMissing; // This means the file/directory doesn't exist. +return std::make_error_code(std::errc::no_such_file_or_directory); } }; Index: unittests/Basic/FileManagerTest.cpp === --- unittests/Basic/FileManagerTest.cpp +++ unittests/Basic/FileManagerTest.cpp @@ -57,9 +57,10 @@ } // Implement FileSystemStatCache::getStat(). - LookupResult getStat(StringRef Path, llvm::vfs::Status , bool isFile, - std::unique_ptr *F, - llvm::vfs::FileSystem ) override { + std::error_code getStat(StringRef Path, llvm::vfs::Status , + bool isFile, + std::unique_ptr *F, + llvm::vfs::FileSystem ) override { #ifndef _WIN32 SmallString<128> NormalizedPath(Path); llvm::sys::path::native(NormalizedPath); @@ -68,10 +69,10 @@ if (StatCalls.count(Path) != 0) { Status = StatCalls[Path]; - return CacheExists; + return std::error_code(); } -return CacheMissing; // This means the file/directory doesn't exist. +return std::make_error_code(std::errc::no_such_file_or_directory); } }; ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D60786: [FileSystemStatCache] Update test for new FileSystemStatCache API
arphaman accepted this revision. arphaman added a comment. This revision is now accepted and ready to land. Herald added a subscriber: ormris. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60786/new/ https://reviews.llvm.org/D60786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D60786: [FileSystemStatCache] Update test for new FileSystemStatCache API
harlanhaskins created this revision. harlanhaskins added a reviewer: arphaman. Herald added subscribers: cfe-commits, dexonsmith. Herald added a project: clang. arphaman accepted this revision. arphaman added a comment. This revision is now accepted and ready to land. Herald added a subscriber: ormris. LG Update this test to return std::error_code instead of LookupResult. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D60786 Files: clang/unittests/Basic/FileManagerTest.cpp Index: clang/unittests/Basic/FileManagerTest.cpp === --- clang/unittests/Basic/FileManagerTest.cpp +++ clang/unittests/Basic/FileManagerTest.cpp @@ -57,9 +57,10 @@ } // Implement FileSystemStatCache::getStat(). - LookupResult getStat(StringRef Path, llvm::vfs::Status , bool isFile, - std::unique_ptr *F, - llvm::vfs::FileSystem ) override { + std::error_code getStat(StringRef Path, llvm::vfs::Status , + bool isFile, + std::unique_ptr *F, + llvm::vfs::FileSystem ) override { #ifndef _WIN32 SmallString<128> NormalizedPath(Path); llvm::sys::path::native(NormalizedPath); @@ -68,10 +69,10 @@ if (StatCalls.count(Path) != 0) { Status = StatCalls[Path]; - return CacheExists; + return std::error_code(); } -return CacheMissing; // This means the file/directory doesn't exist. +return std::make_error_code(std::errc::no_such_file_or_directory); } }; Index: clang/unittests/Basic/FileManagerTest.cpp === --- clang/unittests/Basic/FileManagerTest.cpp +++ clang/unittests/Basic/FileManagerTest.cpp @@ -57,9 +57,10 @@ } // Implement FileSystemStatCache::getStat(). - LookupResult getStat(StringRef Path, llvm::vfs::Status , bool isFile, - std::unique_ptr *F, - llvm::vfs::FileSystem ) override { + std::error_code getStat(StringRef Path, llvm::vfs::Status , + bool isFile, + std::unique_ptr *F, + llvm::vfs::FileSystem ) override { #ifndef _WIN32 SmallString<128> NormalizedPath(Path); llvm::sys::path::native(NormalizedPath); @@ -68,10 +69,10 @@ if (StatCalls.count(Path) != 0) { Status = StatCalls[Path]; - return CacheExists; + return std::error_code(); } -return CacheMissing; // This means the file/directory doesn't exist. +return std::make_error_code(std::errc::no_such_file_or_directory); } }; ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits