[PATCH] D33960: ErrorHandling: report_fatal_error: call abort() instead of exit()

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 16:41:37 PDT 2017


MatzeB updated this revision to Diff 114098.
MatzeB retitled this revision from "ErrorHandling: Replace exit() with abort() for debug builds." to "ErrorHandling: report_fatal_error: call abort() instead of exit()".
MatzeB edited the summary of this revision.
MatzeB added a comment.
Herald added subscribers: fedor.sergeev, kbarton, eraman, javed.absar, nhaehnle, nemanjai, sdardis, emaste, jyknight, qcolombet, jholewinski.

Turns out this affects a bunch of testcases. Updating them here.

- There is a problem with `test/Other/close-stderr.ll` which expected an `exit(1)` when printing to stderr fails. With this patch in place we do `report_fatal_error()` that the write to stderr failed and end up in an `abort()` again. Is it okay to remove the test?
- I decided that it may be best to always call abort(). This avoid an unnecessary discrepancy between release/debug builds and it turns out that frontends like clang or swift registers a custom handlers for fatal errors anyway and are not affected by this change.


Repository:
  rL LLVM

https://reviews.llvm.org/D33960

Files:
  lib/Support/ErrorHandling.cpp
  test/Assembler/getInt.ll
  test/Assembler/invalid-datalayout-alloca-addrspace.ll
  test/Assembler/invalid-datalayout1.ll
  test/Assembler/invalid-datalayout10.ll
  test/Assembler/invalid-datalayout11.ll
  test/Assembler/invalid-datalayout12.ll
  test/Assembler/invalid-datalayout13.ll
  test/Assembler/invalid-datalayout14.ll
  test/Assembler/invalid-datalayout15.ll
  test/Assembler/invalid-datalayout16.ll
  test/Assembler/invalid-datalayout17.ll
  test/Assembler/invalid-datalayout18.ll
  test/Assembler/invalid-datalayout19.ll
  test/Assembler/invalid-datalayout2.ll
  test/Assembler/invalid-datalayout20.ll
  test/Assembler/invalid-datalayout21.ll
  test/Assembler/invalid-datalayout22.ll
  test/Assembler/invalid-datalayout23.ll
  test/Assembler/invalid-datalayout24.ll
  test/Assembler/invalid-datalayout3.ll
  test/Assembler/invalid-datalayout4.ll
  test/Assembler/invalid-datalayout5.ll
  test/Assembler/invalid-datalayout6.ll
  test/Assembler/invalid-datalayout7.ll
  test/Assembler/invalid-datalayout8.ll
  test/Assembler/invalid-datalayout9.ll
  test/Bitcode/invalid.test
  test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
  test/CodeGen/AArch64/GlobalISel/verify-regbankselected.mir
  test/CodeGen/AArch64/GlobalISel/verify-selected.mir
  test/CodeGen/AArch64/aarch64-named-reg-w18.ll
  test/CodeGen/AArch64/aarch64-named-reg-x18.ll
  test/CodeGen/AArch64/arm64-anyregcc-crash.ll
  test/CodeGen/AArch64/arm64-named-reg-alloc.ll
  test/CodeGen/AArch64/arm64-named-reg-notareg.ll
  test/CodeGen/AArch64/fast-isel-sp-adjust.ll
  test/CodeGen/AMDGPU/branch-relax-spill.ll
  test/CodeGen/AMDGPU/lds-initializer.ll
  test/CodeGen/AMDGPU/lds-zero-initializer.ll
  test/CodeGen/AMDGPU/read-register-invalid-subtarget.ll
  test/CodeGen/AMDGPU/read-register-invalid-type-i32.ll
  test/CodeGen/AMDGPU/read-register-invalid-type-i64.ll
  test/CodeGen/ARM/cdp.ll
  test/CodeGen/ARM/cdp2.ll
  test/CodeGen/ARM/ldc2l.ll
  test/CodeGen/ARM/named-reg-alloc.ll
  test/CodeGen/ARM/named-reg-notareg.ll
  test/CodeGen/ARM/special-reg-acore.ll
  test/CodeGen/ARM/special-reg-mcore.ll
  test/CodeGen/ARM/special-reg-v8m-base.ll
  test/CodeGen/ARM/special-reg-v8m-main.ll
  test/CodeGen/ARM/ssat-lower.ll
  test/CodeGen/ARM/ssat-upper.ll
  test/CodeGen/ARM/ssat-v4t.ll
  test/CodeGen/ARM/stc2.ll
  test/CodeGen/ARM/usat-lower.ll
  test/CodeGen/ARM/usat-upper.ll
  test/CodeGen/ARM/usat-v4t.ll
  test/CodeGen/BPF/sdiv_error.ll
  test/CodeGen/Generic/llc-start-stop.ll
  test/CodeGen/Generic/opt-codegen-no-target-machine.ll
  test/CodeGen/MIR/X86/machine-verifier.mir
  test/CodeGen/MIR/X86/tied-physical-regs-match.mir
  test/CodeGen/Mips/Fast-ISel/double-arg.ll
  test/CodeGen/Mips/Fast-ISel/fast-isel-softfloat-lower-args.ll
  test/CodeGen/Mips/fp64a.ll
  test/CodeGen/Mips/fpxx.ll
  test/CodeGen/Mips/interrupt-attr-64-error.ll
  test/CodeGen/Mips/interrupt-attr-args-error.ll
  test/CodeGen/Mips/interrupt-attr-error.ll
  test/CodeGen/Mips/mips32r6/compatibility.ll
  test/CodeGen/Mips/mips64r6/compatibility.ll
  test/CodeGen/Mips/msa/3r-a.ll
  test/CodeGen/Mips/msa/immediates-bad.ll
  test/CodeGen/NVPTX/alias.ll
  test/CodeGen/NVPTX/fcos-no-fast-math.ll
  test/CodeGen/NVPTX/fsin-no-fast-math.ll
  test/CodeGen/NVPTX/global-ctor.ll
  test/CodeGen/NVPTX/global-dtor.ll
  test/CodeGen/NVPTX/zero-cs.ll
  test/CodeGen/PowerPC/named-reg-alloc-r0.ll
  test/CodeGen/PowerPC/named-reg-alloc-r13.ll
  test/CodeGen/PowerPC/named-reg-alloc-r2-64.ll
  test/CodeGen/PowerPC/named-reg-alloc-r2.ll
  test/CodeGen/PowerPC/ppc64-anyregcc-crash.ll
  test/CodeGen/PowerPC/ppc64-icbt-pwr7.ll
  test/CodeGen/SPARC/fail-alloca-align.ll
  test/CodeGen/SPARC/sret-secondary.ll
  test/CodeGen/SystemZ/vec-args-error-01.ll
  test/CodeGen/SystemZ/vec-args-error-02.ll
  test/CodeGen/SystemZ/vec-args-error-03.ll
  test/CodeGen/SystemZ/vec-args-error-04.ll
  test/CodeGen/SystemZ/vec-args-error-05.ll
  test/CodeGen/SystemZ/vec-args-error-06.ll
  test/CodeGen/SystemZ/vec-args-error-07.ll
  test/CodeGen/SystemZ/vec-args-error-08.ll
  test/CodeGen/X86/AppendingLinkage.ll
  test/CodeGen/X86/anyregcc-crash.ll
  test/CodeGen/X86/coff-comdat2.ll
  test/CodeGen/X86/coff-comdat3.ll
  test/CodeGen/X86/equiv_with_fndef.ll
  test/CodeGen/X86/equiv_with_vardef.ll
  test/CodeGen/X86/fast-isel-args-fail2.ll
  test/CodeGen/X86/inalloca-regparm.ll
  test/CodeGen/X86/invalid-liveness.mir
  test/CodeGen/X86/label-redefinition.ll
  test/CodeGen/X86/macho-comdat.ll
  test/CodeGen/X86/named-reg-alloc.ll
  test/CodeGen/X86/named-reg-notareg.ll
  test/CodeGen/X86/nonconst-static-ev.ll
  test/CodeGen/X86/nonconst-static-iv.ll
  test/CodeGen/X86/pr33772.ll
  test/CodeGen/X86/read-fp-no-frame-pointer.ll
  test/CodeGen/X86/segmented-stacks.ll
  test/CodeGen/X86/sha.ll
  test/CodeGen/XCore/alignment.ll
  test/CodeGen/XCore/codemodel.ll
  test/CodeGen/XCore/section-name.ll
  test/LTO/X86/attrs.ll
  test/LTO/X86/strip-debug-info.ll
  test/MC/ARM/Windows/invalid-relocation.s
  test/MC/AsmParser/cfi-unfinished-frame.s
  test/MC/COFF/section-comdat-conflict.s
  test/MC/COFF/section-comdat-conflict2.s
  test/MC/COFF/seh-stackalloc-zero.s
  test/MC/Disassembler/AMDGPU/si-support.txt
  test/MC/ELF/ARM/bss-non-zero-value.s
  test/MC/ELF/common-error3.s
  test/MC/ELF/invalid-symver.s
  test/MC/ELF/section-numeric-invalid-type.s
  test/MC/MachO/variable-errors.s
  test/MC/Mips/nooddspreg-cmdarg.s
  test/MC/PowerPC/ppc64-localentry-error1.s
  test/MC/PowerPC/ppc64-localentry-error2.s
  test/MC/PowerPC/pr24686.s
  test/MC/X86/AlignedBundling/bundle-group-too-large-error.s
  test/MC/X86/AlignedBundling/bundle-lock-option-error.s
  test/MC/X86/AlignedBundling/lock-without-bundle-mode-error.s
  test/MC/X86/AlignedBundling/switch-section-locked-error.s
  test/MC/X86/AlignedBundling/unlock-without-lock-error.s
  test/MC/X86/encoder-fail.s
  test/MC/X86/invalid-sleb.s
  test/MC/X86/reloc-bss.s
  test/Object/coff-invalid.test
  test/Object/corrupt.test
  test/Object/invalid.test
  test/Other/close-stderr.ll
  test/Other/optimization-remarks-inline.ll
  test/Transforms/GCOVProfiling/version.ll
  test/Verifier/test_g_phi.mir
  test/tools/llvm-lto2/X86/pipeline.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33960.114098.patch
Type: text/x-patch
Size: 83784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170906/b946994b/attachment-0001.bin>


More information about the llvm-commits mailing list