[PATCH] D86657: Add new hidden option -print-crash-IR that prints out IR that caused opt pipeline to crash

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 15:49:46 PDT 2020


aeubanks added a comment.

overall lgtm with some nits, but I'd like yrouban to take a look at the signal handler



================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:59-60
+// A hidden option to print the IR that was being processed when a pass
+// crashes.  Note that nothing will be output if there is no crash.  This
+// option is affected by the -print-module-scope option.
+static cl::opt<bool>
----------------
the last two sentences seem unnecessary. also `hidden option` doesn't need to be specified here and in the commit description.

So just "Print the IR being processed when a pass crashes" is good enough IMO


================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:520
+
+inline void PrintCrashIRInstrumentation::reportCrashIR() { dbgs() << SavedIR; }
+
----------------
why is this `inline`?


================
Comment at: llvm/test/Other/print-on-crash.ll:23
+
+define dso_local signext i32 @main() #0 {
+entry:
----------------
nitpicking, but reducing this to
`define i32 @main() {`
would be ideal


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86657/new/

https://reviews.llvm.org/D86657



More information about the llvm-commits mailing list