aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-20 17:46:46 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-20 17:46:46 +0000
commit1c2e9332fa69727425a3a2b912e36e2ab62083f8 (patch)
treee37d5a66ca966268298e869872def24606e0c78f /lib/Lex/HeaderSearch.cpp
parent1bea8807bcd2be10bf6309a3a848489434464ced (diff)
Allow preprocessor callbacks to recover from a "file not found" error,
from Jason Haslam! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
-rw-r--r--lib/Lex/HeaderSearch.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 4deba60b9d..318e57dc01 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -408,7 +408,8 @@ const FileEntry *HeaderSearch::LookupFile(
const FileEntry *CurFileEnt,
SmallVectorImpl<char> *SearchPath,
SmallVectorImpl<char> *RelativePath,
- ModuleMap::Module **SuggestedModule)
+ ModuleMap::Module **SuggestedModule,
+ bool SkipCache)
{
if (SuggestedModule)
*SuggestedModule = 0;
@@ -484,7 +485,7 @@ const FileEntry *HeaderSearch::LookupFile(
// If the entry has been previously looked up, the first value will be
// non-zero. If the value is equal to i (the start point of our search), then
// this is a matching hit.
- if (CacheLookup.first == i+1) {
+ if (!SkipCache && CacheLookup.first == i+1) {
// Skip querying potentially lots of directories for this lookup.
i = CacheLookup.second;
} else {