diff options
author | Jim Grosbach <grosbach@apple.com> | 2009-05-12 23:59:14 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2009-05-12 23:59:14 +0000 |
commit | 0e0da734bbdfa1d3f55cd04db31d83b97e4556f7 (patch) | |
tree | aa04b7f115b464f914893e1e637c808794af646e /include | |
parent | 9d3094b38e51c85e93fc5a9c8ab23c95b73f78d4 (diff) | |
download | llvm-0e0da734bbdfa1d3f55cd04db31d83b97e4556f7.tar.gz llvm-0e0da734bbdfa1d3f55cd04db31d83b97e4556f7.tar.bz2 llvm-0e0da734bbdfa1d3f55cd04db31d83b97e4556f7.tar.xz |
Add support for GCC compatible builtin setjmp and longjmp intrinsics. This is
a supporting preliminary patch for GCC-compatible SjLJ exception handling. Note that these intrinsics are not designed to be invoked directly by the user, but
rather used by the front-end as target hooks for exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineFunction.h | 12 | ||||
-rw-r--r-- | include/llvm/Intrinsics.td | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index a110e5846a..469ae026f0 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -70,6 +70,10 @@ class MachineFunction : private Annotation { const Function *Fn; const TargetMachine &Target; + // HasBuiltinSetjmp - true if the function uses builtin_setjmp. Used to + // adjust callee-saved register tracking. + bool HasBuiltinSetjmp; + // RegInfo - Information about each register in use in the function. MachineRegisterInfo *RegInfo; @@ -123,6 +127,14 @@ public: /// const TargetMachine &getTarget() const { return Target; } + /// doesHaveBuiltinSetjmp - Return whether this function uses builtin_setjmp + /// + bool doesHaveBuiltinSetjmp() const { return HasBuiltinSetjmp; } + + /// setHasBuiltinSetjmp - Mark whether this function uses builtin_setjmp + /// + void setHasBuiltinSetjmp (bool flag) { HasBuiltinSetjmp = flag; } + /// getRegInfo - Return information about the registers currently in use. /// MachineRegisterInfo &getRegInfo() { return *RegInfo; } diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td index 6e4ce82c4c..7c869f0aa3 100644 --- a/include/llvm/Intrinsics.td +++ b/include/llvm/Intrinsics.td @@ -299,6 +299,11 @@ def int_eh_unwind_init: Intrinsic<[llvm_void_ty]>, def int_eh_dwarf_cfa : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty]>; +let Properties = [IntrNoMem] in { +def int_builtinsetjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>; +def int_builtinlongjmp : Intrinsic<[llvm_void_ty], [llvm_ptr_ty, llvm_i32_ty]>; +} + //===---------------- Generic Variable Attribute Intrinsics----------------===// // def int_var_annotation : Intrinsic<[llvm_void_ty], |