Fix __builtin_setjmp in combination with sjlj exception handling.
authorMatthias Braun <matze@braunis.de>
Thu, 16 Jul 2015 22:34:16 +0000 (22:34 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 16 Jul 2015 22:34:16 +0000 (22:34 +0000)
commit9e4654db1accb25f8f07c6382216ad605d4978a4
treeba55ff32f6f4c6f74160f35c2ea9211e75f0d9e2
parentec56faaa6410568526889da22b7d30f92a85013d
Fix __builtin_setjmp in combination with sjlj exception handling.

llvm.eh.sjlj.setjmp was used as part of the SjLj exception handling
style but is also used in clang to implement __builtin_setjmp.  The ARM
backend needs to output additional dispatch tables for the SjLj
exception handling style, these tables however can't be emitted if
llvm.eh.sjlj.setjmp is simply used for __builtin_setjmp and no actual
landing pad blocks exist.

To solve this issue a new llvm.eh.sjlj.setup_dispatch intrinsic is
introduced which is used instead of llvm.eh.sjlj.setjmp in the SjLj
exception handling lowering, so we can differentiate between the case
where we actually need to setup a dispatch table and the case where we
just need the __builtin_setjmp semantic.

Differential Revision: http://reviews.llvm.org/D9313

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242481 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/ISDOpcodes.h
include/llvm/IR/Intrinsics.td
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
lib/CodeGen/SjLjEHPrepare.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
lib/Target/ARM/ARMInstrInfo.td
test/CodeGen/ARM/setjmp_longjmp.ll [new file with mode: 0644]