summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/FileSystemStatCache.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/FileSystemStatCache.h')
-rw-r--r--include/clang/Basic/FileSystemStatCache.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h
index a802c7c..ff70373 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 <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
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
OpenPOWER on IntegriCloud