This patch allows libclang to report a parser crash that's caused by #pragma clang __debug parser_crash without using the LLVM_BUILTIN_TRAP. Instead a new flag in PPOpts is used to let libclang know that a simulated crash has occurred. This flag allows clients to test that libclang can report a parser crash (CXError_Crash) when libclang is ran under a debugger that breaks on LLVM_BUILTIN_TRAP.
Details
Details
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
Comment Actions
Did you consider just using a different pragma that triggers this behaviour instead of avoiding the crash? I don't really have a strong preference but I'd be interested to hear what you think the pros/cons are.
lib/Parse/ParseDecl.cpp | ||
---|---|---|
5657 | This should return immediately (and keep exiting until ~ParseAST) or it won't really behave like a trap. |
Comment Actions
It turns out there's already something that works much better: #pragma clang __debug handle_crash. Sorry about the redundant patch!
This should return immediately (and keep exiting until ~ParseAST) or it won't really behave like a trap.