[Support] Make report_fatal_error respect its GenCrashDiag argument so it doesn't...
authorNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
Mon, 30 May 2022 18:16:06 +0000 (19:16 +0100)
committerNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
Mon, 30 May 2022 18:19:23 +0000 (19:19 +0100)
commit80b3dcc045f8ea6e5e532d8891bbf1305bce89e8
treea5f204b60e44a2f016f2c5b054841d16340d8cad
parentc4eb8035ed6647e58d4c5161f393e9220f7402cf
[Support] Make report_fatal_error respect its GenCrashDiag argument so it doesn't generate a backtrace

There are a few places where we use report_fatal_error when the input is broken.
Currently, this function always crashes LLVM with an abort signal, which
then triggers the backtrace printing code.
I think this is excessive, as wrong input shouldn't give a link to
LLVM's github issue URL and tell users to file a bug report.
We shouldn't print a stack trace either.

This patch changes report_fatal_error so it uses exit() rather than
abort() when its argument GenCrashDiag=false.

Reviewed by: nikic, MaskRay, RKSimon

Differential Revision: https://reviews.llvm.org/D126550
28 files changed:
llvm/lib/Support/ErrorHandling.cpp
llvm/lib/Target/Mips/MipsSubtarget.cpp
llvm/lib/Transforms/IPO/BlockExtractor.cpp
llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/test/CodeGen/ARM/codemodel.ll
llvm/test/CodeGen/BPF/xadd.ll
llvm/test/CodeGen/Lanai/codemodel.ll
llvm/test/CodeGen/Mips/cpus.ll
llvm/test/CodeGen/Mips/fp64a.ll
llvm/test/CodeGen/Mips/fpxx.ll
llvm/test/CodeGen/Mips/micromips64-unsupported.ll
llvm/test/CodeGen/Mips/mips32r6/compatibility.ll
llvm/test/CodeGen/Mips/mips64r6/compatibility.ll
llvm/test/CodeGen/Mips/msa/3r-a.ll
llvm/test/CodeGen/PowerPC/codemodel.ll
llvm/test/CodeGen/SPARC/codemodel.ll
llvm/test/CodeGen/SystemZ/codemodel.ll
llvm/test/CodeGen/WebAssembly/tls-general-dynamic.ll
llvm/test/CodeGen/X86/codemodel.ll
llvm/test/MC/Mips/micromips64-unsupported.s
llvm/test/MC/Mips/micromips64r6-unsupported.s
llvm/test/Other/optimization-remarks-inline.ll
llvm/test/Transforms/BlockExtractor/invalid-block.ll
llvm/test/Transforms/BlockExtractor/invalid-function.ll
llvm/test/Transforms/BlockExtractor/invalid-line.ll
llvm/test/Transforms/GCOVProfiling/version.ll
llvm/test/Transforms/LoopUnroll/peel-loop-and-unroll.ll