From 809500fc2c13c8173a16b052304d983864e4a1e1 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 8 Apr 2013 18:45:10 +0000 Subject: Vendor import of clang trunk r178860: http://llvm.org/svn/llvm-project/cfe/trunk@178860 --- include/clang/Basic/FileSystemStatCache.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'include/clang/Basic/FileSystemStatCache.h') diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h index a802c7cc748e0..ff70373ffb067 100644 --- a/include/clang/Basic/FileSystemStatCache.h +++ b/include/clang/Basic/FileSystemStatCache.h @@ -18,8 +18,8 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/StringMap.h" -#include #include +#include namespace clang { @@ -44,13 +44,13 @@ public: /// /// \returns \c true if the path does not exist or \c false if it exists. /// - /// If FileDescriptor is non-null, then this lookup should only return success - /// for files (not directories). If it is null this lookup should only return + /// If isFile is true, then this lookup should only return success for files + /// (not directories). If it is false this lookup should only return /// success for directories (not files). On a successful file lookup, the /// implementation can optionally fill in FileDescriptor with a valid /// descriptor and the client guarantees that it will close it. - static bool get(const char *Path, struct stat &StatBuf, int *FileDescriptor, - FileSystemStatCache *Cache); + static bool get(const char *Path, struct stat &StatBuf, + bool isFile, int *FileDescriptor, FileSystemStatCache *Cache); /// \brief Sets the next stat call cache in the chain of stat caches. @@ -69,16 +69,17 @@ public: protected: virtual LookupResult getStat(const char *Path, struct stat &StatBuf, - int *FileDescriptor) = 0; + bool isFile, int *FileDescriptor) = 0; LookupResult statChained(const char *Path, struct stat &StatBuf, - int *FileDescriptor) { + bool isFile, int *FileDescriptor) { if (FileSystemStatCache *Next = getNextStatCache()) - return Next->getStat(Path, StatBuf, FileDescriptor); + return Next->getStat(Path, StatBuf, isFile, FileDescriptor); // If we hit the end of the list of stat caches to try, just compute and // return it without a cache. - return get(Path, StatBuf, FileDescriptor, 0) ? CacheMissing : CacheExists; + return get(Path, StatBuf, + isFile, FileDescriptor, 0) ? CacheMissing : CacheExists; } }; @@ -97,7 +98,7 @@ public: iterator end() const { return StatCalls.end(); } virtual LookupResult getStat(const char *Path, struct stat &StatBuf, - int *FileDescriptor); + bool isFile, int *FileDescriptor); }; } // end namespace clang -- cgit v1.2.3