aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/GeneratePCH.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/GeneratePCH.cpp')
-rw-r--r--lib/Frontend/GeneratePCH.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Frontend/GeneratePCH.cpp b/lib/Frontend/GeneratePCH.cpp
index 2f3df9479d..422a4b6264 100644
--- a/lib/Frontend/GeneratePCH.cpp
+++ b/lib/Frontend/GeneratePCH.cpp
@@ -54,7 +54,10 @@ PCHGenerator::PCHGenerator(const Preprocessor &PP,
// Install a stat() listener to keep track of all of the stat()
// calls.
StatCalls = new MemorizeStatCalls;
- PP.getFileManager().addStatCache(StatCalls, /*AtBeginning=*/true);
+ // If we have a chain, we want new stat calls only, so install the memorizer
+ // *after* the already installed PCHReader's stat cache.
+ PP.getFileManager().addStatCache(StatCalls,
+ /*AtBeginning=*/!Chain);
}
void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) {