]> granicus.if.org Git - clang/commitdiff
Allow disabling PCH validation when loading an AST file by checking
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 15 Sep 2012 01:10:20 +0000 (01:10 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 15 Sep 2012 01:10:20 +0000 (01:10 +0000)
an environment variable for debugging purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163958 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/ASTUnit.cpp

index d0aadfd29ea97f6d1602ee3c77519177e43444c9..cb7ff1efd31eb2458bfe46f47b28dcb30d2a4962 100644 (file)
@@ -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));