diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-07-27 00:27:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-07-27 00:27:13 +0000 |
commit | ce3a8293a0473078fa29178a00f2dc7945438572 (patch) | |
tree | 9210962cc780ebdb66a91e7ba93654bb8f5e2c48 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 66c5eef182dc5adab30d50a2e73de3b31109d305 (diff) | |
download | bcm5719-llvm-ce3a8293a0473078fa29178a00f2dc7945438572.tar.gz bcm5719-llvm-ce3a8293a0473078fa29178a00f2dc7945438572.zip |
Implement -fno-validate-pch at the -cc1 level, which suppresses most
of the usual consistency checks used to determine when a precompiled
header is incompatible with the translation unit it's being loaded
into.
Enable this option when loading a precompiled preamble, because the
preamble loader will be performing all of this checking itself. Enable
the preamble-based test now that it's working.
This option is also useful for debugging Clang's PCH
(<rdar://problem/7532213>).
llvm-svn: 109475
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 0b1041f8412..ea295687aa0 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -250,9 +250,11 @@ void CompilerInstance::createASTContext() { // ExternalASTSource -void CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path) { +void CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path, + bool DisablePCHValidation) { llvm::OwningPtr<ExternalASTSource> Source; Source.reset(createPCHExternalASTSource(Path, getHeaderSearchOpts().Sysroot, + DisablePCHValidation, getPreprocessor(), getASTContext())); // Remember the PCHReader, but in a non-owning way. Reader = static_cast<PCHReader*>(Source.get()); @@ -262,11 +264,13 @@ void CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path) { ExternalASTSource * CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path, const std::string &Sysroot, + bool DisablePCHValidation, Preprocessor &PP, ASTContext &Context) { llvm::OwningPtr<PCHReader> Reader; Reader.reset(new PCHReader(PP, &Context, - Sysroot.empty() ? 0 : Sysroot.c_str())); + Sysroot.empty() ? 0 : Sysroot.c_str(), + DisablePCHValidation)); switch (Reader->ReadPCH(Path)) { case PCHReader::Success: |