diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-23 20:05:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-23 20:05:15 +0000 |
commit | d6f611198089b78e32d3a15fe8bc986204aee1aa (patch) | |
tree | d6395cf05d36ad6d8d5bba6a418b0f8396e00928 /lib/Frontend/CacheTokens.cpp | |
parent | 11aa4b03b054cb9d3c201bba5632241145865e29 (diff) |
simplify the cache miss handling code, eliminating CacheMissing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CacheTokens.cpp')
-rw-r--r-- | lib/Frontend/CacheTokens.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp index 94bee6b868..2a7af8a8c3 100644 --- a/lib/Frontend/CacheTokens.cpp +++ b/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. |