Skip to content

Commit f19c584

Browse files
committed
If clang >= 10, don't crash on #pragma clang __debug
1 parent c3ea7dc commit f19c584

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/clang_tu.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
160160
auto &isec = ci->getFrontendOpts().Inputs;
161161
if (isec.size())
162162
isec[0] = FrontendInputFile(main, isec[0].getKind(), isec[0].isSystem());
163+
#if LLVM_VERSION_MAJOR >= 10 // llvmorg-11-init-2414-g75f09b54429
164+
ci->getPreprocessorOpts().DisablePragmaDebugCrash = true;
165+
#endif
163166
// clangSerialization has an unstable format. Disable PCH reading/writing
164167
// to work around PCH mismatch problems.
165168
ci->getPreprocessorOpts().ImplicitPCHInclude.clear();

0 commit comments

Comments
 (0)