From ce3a8293a0473078fa29178a00f2dc7945438572 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 27 Jul 2010 00:27:13 +0000 Subject: 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 (). llvm-svn: 109475 --- clang/lib/Frontend/CompilerInstance.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') 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 Source; Source.reset(createPCHExternalASTSource(Path, getHeaderSearchOpts().Sysroot, + DisablePCHValidation, getPreprocessor(), getASTContext())); // Remember the PCHReader, but in a non-owning way. Reader = static_cast(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 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: -- cgit v1.2.3