aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-09-15 01:10:20 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-09-15 01:10:20 +0000
commit98e95bf1c84560684356088af7f4878bdacb5856 (patch)
tree2935233e0ef26ab27f4cc1f2408d6b884510eabd /lib/Frontend/ASTUnit.cpp
parent12f5fe5f4ee9318a11e299f199f61eea05a2a450 (diff)
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
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp5
1 files changed, 4 insertions, 1 deletions
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));