A new option -print-on-crash that prints the IR as it was upon entering the last...
authorJamie Schmeiser <schmeise@ca.ibm.com>
Tue, 23 Mar 2021 13:27:30 +0000 (09:27 -0400)
committerJamie Schmeiser <schmeise@ca.ibm.com>
Tue, 23 Mar 2021 13:29:17 +0000 (09:29 -0400)
commit9544a32287eccb42a4367cff9b5888855d6b8756
tree9e7c951b1aa3a0fb61f5a0c2a065a146e7abe1a0
parente19884cd7462ecba5eb569cdfb0efa4be58b07ff
A new option -print-on-crash that prints the IR as it was upon entering the last pass when there is a crash.
Summary:
The IR is saved in its print form before each pass is started and a
signal handler is registered.  If the compilation crashes, the signal
handler will print the saved IR to dbgs().  This option
can be modified using -print-module-scope to get the IR for the complete
module.  Note that this option only works with the new pass manager.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks) yrouban (Yevgeny Rouban)
Differential Revision: https://reviews.llvm.org/D86657
llvm/include/llvm/Passes/StandardInstrumentations.h
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Passes/StandardInstrumentations.cpp
llvm/test/Other/print-on-crash.ll [new file with mode: 0644]