From: Argyrios Kyrtzidis Date: Sat, 15 Sep 2012 01:10:20 +0000 (+0000) Subject: Allow disabling PCH validation when loading an AST file by checking X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98e95bf1c84560684356088af7f4878bdacb5856;p=clang Allow disabling PCH validation when loading an AST file by checking an environment variable for debugging purposes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163958 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index d0aadfd29e..cb7ff1efd3 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -772,9 +772,12 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, /*DelayInitialization=*/true); ASTContext &Context = *AST->Ctx; + bool disableValid = false; + if (::getenv("LIBCLANG_DISABLE_PCH_VALIDATION")) + disableValid = true; Reader.reset(new ASTReader(PP, Context, /*isysroot=*/"", - /*DisableValidation=*/false, + /*DisableValidation=*/disableValid, /*DisableStatCache=*/false, AllowPCHWithCompilerErrors));