summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/FileSystemStatCache.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2018-12-21 19:33:09 +0000
committerAlex Lorenz <arphaman@gmail.com>2018-12-21 19:33:09 +0000
commitd92b1ae1d769bbb4175e9de3dbe8b14cdd889975 (patch)
treedb815c3ae0a9dd74ccf38cac9291931e2d69d4cf /clang/lib/Basic/FileSystemStatCache.cpp
parentafe9673df224b692f820fe6a9c1d0a1dede2b4a4 (diff)
downloadbcm5719-llvm-d92b1ae1d769bbb4175e9de3dbe8b14cdd889975.tar.gz
bcm5719-llvm-d92b1ae1d769bbb4175e9de3dbe8b14cdd889975.zip
Remove stat cache chaining as it's no longer needed after PTH support has been
removed Stat cache chaining was implemented for a StatListener in the PTH writer so that it could write out the stat information to PTH. r348266 removed support for PTH, and it doesn't seem like there are other uses of stat cache chaining. We can remove the chaining support. Differential Revision: https://reviews.llvm.org/D55455 llvm-svn: 349942
Diffstat (limited to 'clang/lib/Basic/FileSystemStatCache.cpp')
-rw-r--r--clang/lib/Basic/FileSystemStatCache.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/Basic/FileSystemStatCache.cpp b/clang/lib/Basic/FileSystemStatCache.cpp
index 9a515e89e2e..6f2eef4e206 100644
--- a/clang/lib/Basic/FileSystemStatCache.cpp
+++ b/clang/lib/Basic/FileSystemStatCache.cpp
@@ -114,18 +114,17 @@ MemorizeStatCalls::LookupResult
MemorizeStatCalls::getStat(StringRef Path, FileData &Data, bool isFile,
std::unique_ptr<llvm::vfs::File> *F,
llvm::vfs::FileSystem &FS) {
- LookupResult Result = statChained(Path, Data, isFile, F, FS);
-
- // Do not cache failed stats, it is easy to construct common inconsistent
- // situations if we do, and they are not important for PCH performance (which
- // currently only needs the stats to construct the initial FileManager
- // entries).
- if (Result == CacheMissing)
- return Result;
+ if (get(Path, Data, isFile, F, nullptr, FS)) {
+ // Do not cache failed stats, it is easy to construct common inconsistent
+ // situations if we do, and they are not important for PCH performance
+ // (which currently only needs the stats to construct the initial
+ // FileManager entries).
+ return CacheMissing;
+ }
// Cache file 'stat' results and directories with absolutely paths.
if (!Data.IsDirectory || llvm::sys::path::is_absolute(Path))
StatCalls[Path] = Data;
- return Result;
+ return CacheExists;
}
OpenPOWER on IntegriCloud