simplify the cache miss handling code, eliminating CacheMissing.

llvm-svn: 120038
This commit is contained in:
Chris Lattner
2010-11-23 20:05:15 +00:00
parent 5769c3dffd
commit 8f0583daa2
5 changed files with 13 additions and 27 deletions

View File

@@ -19,16 +19,11 @@ MemorizeStatCalls::LookupResult
MemorizeStatCalls::getStat(const char *Path, struct stat &StatBuf) {
LookupResult Result = 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;
// 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 == CacheHitMissing)
if (Result == CacheMissing)
return Result;
// Cache file 'stat' results and directories with absolutely paths.