aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CacheTokens.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-11 07:48:23 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-11 07:48:23 +0000
commit3b7793797f773ee0132b38767b104ad80af75229 (patch)
treecf23e1f1775f3baa245e66f82fece41cd860b09c /clang/lib/Frontend/CacheTokens.cpp
parent53c3877f94635ed77ccb35cd1dffc3b44e42dff4 (diff)
downloadllvm-3b7793797f773ee0132b38767b104ad80af75229.zip
llvm-3b7793797f773ee0132b38767b104ad80af75229.tar.gz
llvm-3b7793797f773ee0132b38767b104ad80af75229.tar.bz2
Extend stat query APIs to explicitly specify if the query is for
a file or directory, allowing just a stat call if a file descriptor is not needed. Doing just 'stat' is faster than 'open/fstat/close'. This has the effect of cutting down system time for validating the input files of a PCH. llvm-svn: 169831
Diffstat (limited to 'clang/lib/Frontend/CacheTokens.cpp')
-rw-r--r--clang/lib/Frontend/CacheTokens.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp
index 26e4b3f..3f80a16 100644
--- a/clang/lib/Frontend/CacheTokens.cpp
+++ b/clang/lib/Frontend/CacheTokens.cpp
@@ -517,8 +517,8 @@ public:
~StatListener() {}
LookupResult getStat(const char *Path, struct stat &StatBuf,
- int *FileDescriptor) {
- LookupResult Result = statChained(Path, StatBuf, FileDescriptor);
+ bool isFile, int *FileDescriptor) {
+ LookupResult Result = statChained(Path, StatBuf, isFile, FileDescriptor);
if (Result == CacheMissing) // Failed 'stat'.
PM.insert(PTHEntryKeyVariant(Path), PTHEntry());