summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CacheTokens.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-23 20:05:15 +0000
committerChris Lattner <sabre@nondot.org>2010-11-23 20:05:15 +0000
commit8f0583daa2864318537a61b12e71c3264c227738 (patch)
tree9b5bc2e69bf0e820f92b5d8d5b42206f431dec8c /clang/lib/Frontend/CacheTokens.cpp
parent5769c3dffd6d7b1d7684c93eaea71e1277846e26 (diff)
downloadbcm5719-llvm-8f0583daa2864318537a61b12e71c3264c227738.tar.gz
bcm5719-llvm-8f0583daa2864318537a61b12e71c3264c227738.zip
simplify the cache miss handling code, eliminating CacheMissing.
llvm-svn: 120038
Diffstat (limited to 'clang/lib/Frontend/CacheTokens.cpp')
-rw-r--r--clang/lib/Frontend/CacheTokens.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp
index 94bee6b868b..2a7af8a8c35 100644
--- a/clang/lib/Frontend/CacheTokens.cpp
+++ b/clang/lib/Frontend/CacheTokens.cpp
@@ -518,14 +518,9 @@ public:
~StatListener() {}
LookupResult getStat(const char *Path, struct stat &StatBuf) {
- LookupResult Result = FileSystemStatCache::statChained(Path, StatBuf);
-
- // If the chained cache didn't know anything about the file, do the stat now
- // so we can record the result.
- if (Result == CacheMiss)
- Result = ::stat(Path, &StatBuf) ? CacheHitMissing : CacheHitExists;
-
- if (Result == CacheHitMissing) // Failed 'stat'.
+ LookupResult Result = statChained(Path, StatBuf);
+
+ if (Result == CacheMissing) // Failed 'stat'.
PM.insert(PTHEntryKeyVariant(Path), PTHEntry());
else if (S_ISDIR(StatBuf.st_mode)) {
// Only cache directories with absolute paths.
OpenPOWER on IntegriCloud