summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorHarlan Haskins <harlan@harlanhaskins.com>2019-04-16 17:34:26 +0000
committerHarlan Haskins <harlan@harlanhaskins.com>2019-04-16 17:34:26 +0000
commiteec3c0f9e304d9832a62ccfb064ed83600648d57 (patch)
tree3f140250440938f934b26affb6f13a09a1984fb2 /clang/lib/Basic/FileManager.cpp
parent9e31584e78755f02076bec71a106572555648a48 (diff)
downloadbcm5719-llvm-eec3c0f9e304d9832a62ccfb064ed83600648d57.tar.gz
bcm5719-llvm-eec3c0f9e304d9832a62ccfb064ed83600648d57.zip
[FileSystemStatCache] Return std::error_code from stat cache methods
Summary: Previously, we would return true/false signifying if the cache/lookup succeeded or failed. Instead, provide clients with the underlying error that was thrown while attempting to look up in the cache. Since clang::FileManager doesn't make use of this information, it discards the error that's received and casts away to bool. This change is NFC. Reviewers: benlangmuir, arphaman Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60735 llvm-svn: 358509
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r--clang/lib/Basic/FileManager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index 0926376cf10..b6a7fde09f3 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/lib/Basic/FileManager.cpp
@@ -429,13 +429,14 @@ bool FileManager::getStatValue(StringRef Path, llvm::vfs::Status &Status,
// FIXME: FileSystemOpts shouldn't be passed in here, all paths should be
// absolute!
if (FileSystemOpts.WorkingDir.empty())
- return FileSystemStatCache::get(Path, Status, isFile, F,StatCache.get(), *FS);
+ return bool(FileSystemStatCache::get(Path, Status, isFile, F,
+ StatCache.get(), *FS));
SmallString<128> FilePath(Path);
FixupRelativePath(FilePath);
- return FileSystemStatCache::get(FilePath.c_str(), Status, isFile, F,
- StatCache.get(), *FS);
+ return bool(FileSystemStatCache::get(FilePath.c_str(), Status, isFile, F,
+ StatCache.get(), *FS));
}
bool FileManager::getNoncachedStatValue(StringRef Path,
OpenPOWER on IntegriCloud