summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp2
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp7
-rw-r--r--clang/lib/Frontend/FrontendAction.cpp1
3 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 1db81cb13e8..1138cd7db0d 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1580,6 +1580,7 @@ bool ASTUnit::Reparse(RemappedFile *RemappedFiles, unsigned NumRemappedFiles) {
// Remap files.
PreprocessorOptions &PPOpts = Invocation->getPreprocessorOpts();
+ PPOpts.DisableStatCache = true;
for (PreprocessorOptions::remapped_file_buffer_iterator
R = PPOpts.remapped_file_buffer_begin(),
REnd = PPOpts.remapped_file_buffer_end();
@@ -1948,6 +1949,7 @@ void ASTUnit::CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column,
// If the main file has been overridden due to the use of a preamble,
// make that override happen and introduce the preamble.
+ PreprocessorOpts.DisableStatCache = true;
StoredDiagnostics.insert(StoredDiagnostics.end(),
this->StoredDiagnostics.begin(),
this->StoredDiagnostics.begin() + NumStoredDiagnosticsFromDriver);
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 92aed39b5c3..412e7111e48 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -234,11 +234,13 @@ void CompilerInstance::createASTContext() {
void CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path,
bool DisablePCHValidation,
+ bool DisableStatCache,
void *DeserializationListener){
llvm::OwningPtr<ExternalASTSource> Source;
bool Preamble = getPreprocessorOpts().PrecompiledPreambleBytes.first != 0;
Source.reset(createPCHExternalASTSource(Path, getHeaderSearchOpts().Sysroot,
- DisablePCHValidation,
+ DisablePCHValidation,
+ DisableStatCache,
getPreprocessor(), getASTContext(),
DeserializationListener,
Preamble));
@@ -249,6 +251,7 @@ ExternalASTSource *
CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path,
const std::string &Sysroot,
bool DisablePCHValidation,
+ bool DisableStatCache,
Preprocessor &PP,
ASTContext &Context,
void *DeserializationListener,
@@ -256,7 +259,7 @@ CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path,
llvm::OwningPtr<ASTReader> Reader;
Reader.reset(new ASTReader(PP, &Context,
Sysroot.empty() ? 0 : Sysroot.c_str(),
- DisablePCHValidation));
+ DisablePCHValidation, DisableStatCache));
Reader->setDeserializationListener(
static_cast<ASTDeserializationListener *>(DeserializationListener));
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index 5f78fb17723..af23923002d 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -224,6 +224,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
CI.createPCHExternalASTSource(
CI.getPreprocessorOpts().ImplicitPCHInclude,
CI.getPreprocessorOpts().DisablePCHValidation,
+ CI.getPreprocessorOpts().DisableStatCache,
DeserialListener);
if (!CI.getASTContext().getExternalSource())
goto failure;
OpenPOWER on IntegriCloud