Skip to content

Commit 3267ca2

Browse files
committedFeb 28, 2016
Add ARM EHABI-related constants to unwind.h.
Adds a number of constants, defined in the ARM EHABI spec, to the Clang lib/Headers/unwind.h header. This is prerequisite for landing http://reviews.llvm.org/D15781, as previously discussed there. Patch by Timon Van Overveldt. llvm-svn: 262178
1 parent 431b0e1 commit 3267ca2

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed
 

‎clang/lib/Headers/unwind.h

+18-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ struct _Unwind_Context;
7979
struct _Unwind_Exception;
8080
typedef enum {
8181
_URC_NO_REASON = 0,
82+
#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
83+
!defined(__ARM_DWARF_EH__)
84+
_URC_OK = 0, /* used by ARM EHABI */
85+
#endif
8286
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
8387

8488
_URC_FATAL_PHASE2_ERROR = 2,
@@ -88,7 +92,11 @@ typedef enum {
8892
_URC_END_OF_STACK = 5,
8993
_URC_HANDLER_FOUND = 6,
9094
_URC_INSTALL_CONTEXT = 7,
91-
_URC_CONTINUE_UNWIND = 8
95+
_URC_CONTINUE_UNWIND = 8,
96+
#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
97+
!defined(__ARM_DWARF_EH__)
98+
_URC_FAILURE = 9 /* used by ARM EHABI */
99+
#endif
92100
} _Unwind_Reason_Code;
93101

94102
typedef enum {
@@ -150,6 +158,15 @@ typedef enum {
150158
_UVRSR_FAILED = 2
151159
} _Unwind_VRS_Result;
152160

161+
#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__ARM_DWARF_EH__)
162+
typedef uint32_t _Unwind_State;
163+
#define _US_VIRTUAL_UNWIND_FRAME ((_Unwind_State)0)
164+
#define _US_UNWIND_FRAME_STARTING ((_Unwind_State)1)
165+
#define _US_UNWIND_FRAME_RESUME ((_Unwind_State)2)
166+
#define _US_ACTION_MASK ((_Unwind_State)3)
167+
#define _US_FORCE_UNWIND ((_Unwind_State)8)
168+
#endif
169+
153170
_Unwind_VRS_Result _Unwind_VRS_Get(struct _Unwind_Context *__context,
154171
_Unwind_VRS_RegClass __regclass,
155172
uint32_t __regno,

0 commit comments

Comments
 (0)