From dd278430a387f1dd916618c3a1b90c14c0064973 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 23 Nov 2010 21:17:56 +0000 Subject: change the 'is directory' indicator to be a null-or-not pointer that is passed down through the APIs, and make FileSystemStatCache::get be the one that filters out directory lookups that hit files. This also paves the way to have stat queries be able to return opened files. llvm-svn: 120060 --- clang/lib/Serialization/ASTReader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Serialization/ASTReader.cpp') diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index dc719a1f938..4994b4944e2 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -1074,14 +1074,15 @@ public: ~ASTStatCache() { delete Cache; } - LookupResult getStat(const char *Path, struct stat &StatBuf) { + LookupResult getStat(const char *Path, struct stat &StatBuf, + int *FileDescriptor) { // Do the lookup for the file's data in the AST file. CacheTy::iterator I = Cache->find(Path); // If we don't get a hit in the AST file just forward to 'stat'. if (I == Cache->end()) { ++NumStatMisses; - return statChained(Path, StatBuf); + return statChained(Path, StatBuf, FileDescriptor); } ++NumStatHits; -- cgit v1.2.3