[PATCH] D74070: [Clang] Don't let gen crash diagnostics fail when '#pragma clang __debug crash' is used

Alexandre Ganea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 5 09:55:51 PST 2020


aganea created this revision.
aganea added reviewers: hans, rnk.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

When `#pragma clang __debug crash` is used, currently `Driver::generateCompilationDiagnostics()` doesn't work. The `clang -E` created for diagnostics would crash again, because it reaches `Pragma.cpp, L1043` again.

We simply disable the intended crashing behavior with a new cc1 flag `-disable-pragma-debug-crash`.

Notes:

- `#pragma clang __debug llvm_report_fatal` isn't currently tested below, because it needs `exit()` to be handled differently in `-fintegrated-cc1` mode.
- This patch is also needed to further test that `-MF` is removed from the gen crash diagnostic cmd-line (currently not the case).

//This patch is point 1. in D73742 <https://reviews.llvm.org/D73742>//


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74070

Files:
  clang/include/clang/Driver/CC1Options.td
  clang/include/clang/Lex/PreprocessorOptions.h
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/lib/Lex/Pragma.cpp
  clang/test/Driver/crash-report.c
  clang/test/Driver/output-file-cleanup.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74070.242663.patch
Type: text/x-patch
Size: 9059 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200205/81629bfe/attachment-0001.bin>


More information about the cfe-commits mailing list