Skip to content

Commit

Permalink
If clang >= 10, don't crash on #pragma clang __debug
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Aug 22, 2020
1 parent 125915e commit aa4d2d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/clang_tu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ 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());
#if LLVM_VERSION_MAJOR >= 10 // llvmorg-11-init-2414-g75f09b54429
ci->getPreprocessorOpts().DisablePragmaDebugCrash = true;
#endif
// clangSerialization has an unstable format. Disable PCH reading/writing
// to work around PCH mismatch problems.
ci->getPreprocessorOpts().ImplicitPCHInclude.clear();
Expand Down

0 comments on commit aa4d2d1

Please sign in to comment.