Skip to content

Commit

Permalink
Disable PCH reading/writing
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jun 15, 2020
1 parent 7a05f1e commit 8cf8a3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/clang_tu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <clang/Driver/Driver.h>
#include <clang/Driver/Tool.h>
#include <clang/Lex/Lexer.h>
#include <clang/Lex/PreprocessorOptions.h>
#include <llvm/Support/Host.h>
#include <llvm/Support/Path.h>

Expand Down Expand Up @@ -148,6 +149,11 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
auto &isec = ci->getFrontendOpts().Inputs;
if (isec.size())
isec[0] = FrontendInputFile(main, isec[0].getKind(), isec[0].isSystem());
// clangSerialization has an unstable format. Disable PCH reading/writing
// to work around PCH mismatch problems.
ci->getPreprocessorOpts().ImplicitPCHInclude.clear();
ci->getPreprocessorOpts().PrecompiledPreambleBytes = {0, false};
ci->getPreprocessorOpts().PCHThroughHeader.clear();
return ci;
}

Expand Down

0 comments on commit 8cf8a3c

Please sign in to comment.