diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-11 07:48:23 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-11 07:48:23 +0000 |
commit | e5d30e3b403539b10aaa52f03875a2243bf88904 (patch) | |
tree | 02565c9c01affb5bf2bda49e218c151a46d1b1e6 /lib/Lex/PTHLexer.cpp | |
parent | f64d25c633fc093528177c2e0fdd096d2f8706d2 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r-- | lib/Lex/PTHLexer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index ab9d837187..2a3206e95a 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -679,13 +679,13 @@ public: ~PTHStatCache() {} LookupResult getStat(const char *Path, struct stat &StatBuf, - int *FileDescriptor) { + bool isFile, int *FileDescriptor) { // Do the lookup for the file's data in the PTH file. CacheTy::iterator I = Cache.find(Path); // If we don't get a hit in the PTH file just forward to 'stat'. if (I == Cache.end()) - return statChained(Path, StatBuf, FileDescriptor); + return statChained(Path, StatBuf, isFile, FileDescriptor); const PTHStatData &Data = *I; |