summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-02-05 22:21:15 +0000
committerBen Langmuir <blangmuir@apple.com>2014-02-05 22:21:15 +0000
commit2cb4a78f9394359e3bb74060774e2245bcb9f4b7 (patch)
tree712d0ddca4e53867a288b5597be5efec6029a1bf /clang/lib/Frontend/CompilerInstance.cpp
parent87769713cf385f373f3bc1c28913045f49277d7f (diff)
downloadbcm5719-llvm-2cb4a78f9394359e3bb74060774e2245bcb9f4b7.tar.gz
bcm5719-llvm-2cb4a78f9394359e3bb74060774e2245bcb9f4b7.zip
Add a CC1 option -verify-pch
This option will: - load the given pch file - verify it is not out of date by stat'ing dependencies, and - return 0 on success and non-zero on error llvm-svn: 200884
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 0d2af334d79..d8381a824c7 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -292,12 +292,14 @@ void CompilerInstance::createASTContext() {
void CompilerInstance::createPCHExternalASTSource(StringRef Path,
bool DisablePCHValidation,
bool AllowPCHWithCompilerErrors,
+ bool AllowConfigurationMismatch,
void *DeserializationListener){
OwningPtr<ExternalASTSource> Source;
bool Preamble = getPreprocessorOpts().PrecompiledPreambleBytes.first != 0;
Source.reset(createPCHExternalASTSource(Path, getHeaderSearchOpts().Sysroot,
DisablePCHValidation,
AllowPCHWithCompilerErrors,
+ AllowConfigurationMismatch,
getPreprocessor(), getASTContext(),
DeserializationListener,
Preamble,
@@ -311,6 +313,7 @@ CompilerInstance::createPCHExternalASTSource(StringRef Path,
const std::string &Sysroot,
bool DisablePCHValidation,
bool AllowPCHWithCompilerErrors,
+ bool AllowConfigurationMismatch,
Preprocessor &PP,
ASTContext &Context,
void *DeserializationListener,
@@ -321,6 +324,7 @@ CompilerInstance::createPCHExternalASTSource(StringRef Path,
Sysroot.empty() ? "" : Sysroot.c_str(),
DisablePCHValidation,
AllowPCHWithCompilerErrors,
+ AllowConfigurationMismatch,
UseGlobalModuleIndex));
Reader->setDeserializationListener(
@@ -329,7 +333,9 @@ CompilerInstance::createPCHExternalASTSource(StringRef Path,
Preamble ? serialization::MK_Preamble
: serialization::MK_PCH,
SourceLocation(),
- ASTReader::ARR_None)) {
+ AllowConfigurationMismatch
+ ? ASTReader::ARR_ConfigurationMismatch
+ : ASTReader::ARR_None)) {
case ASTReader::Success:
// Set the predefines buffer as suggested by the PCH reader. Typically, the
// predefines buffer will be empty.
@@ -1158,6 +1164,7 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
Sysroot.empty() ? "" : Sysroot.c_str(),
PPOpts.DisablePCHValidation,
/*AllowASTWithCompilerErrors=*/false,
+ /*AllowConfigurationMismatch=*/false,
getFrontendOpts().UseGlobalModuleIndex);
if (hasASTConsumer()) {
ModuleManager->setDeserializationListener(
OpenPOWER on IntegriCloud