aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-27 00:27:13 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-27 00:27:13 +0000
commitfae3b2f4743dad616623c4df2fdb0f5128bd36d9 (patch)
tree9660c0f303a9e19e8d3eeb6e16ac3d5d9287e8a8 /lib/Frontend/CompilerInstance.cpp
parent681d7237e1014bf64dd5ead6bf74ae55cdd19e61 (diff)
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>). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 0b1041f841..ea295687aa 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/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: