[PATCH] D15883: Add ARM EHABI-related constants to unwind.h.

Timon Van Overveldt via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 15 15:45:20 PST 2016


timonvo updated this revision to Diff 48026.
timonvo added a comment.

Added local macro for enhanced readability.


http://reviews.llvm.org/D15883

Files:
  lib/Headers/unwind.h

Index: lib/Headers/unwind.h
===================================================================
--- lib/Headers/unwind.h
+++ lib/Headers/unwind.h
@@ -53,6 +53,13 @@
 # endif
 #else
 
+#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
+    !defined(__ARM_DWARF_EH__)
+#define _UNWIND_ARM_EHABI 1
+#else
+#define _UNWIND_ARM_EHABI 0
+#endif
+
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -79,6 +86,9 @@
 struct _Unwind_Exception;
 typedef enum {
   _URC_NO_REASON = 0,
+#if _UNWIND_ARM_EHABI
+  _URC_OK = 0, /* used by ARM EHABI */
+#endif
   _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
 
   _URC_FATAL_PHASE2_ERROR = 2,
@@ -88,7 +98,10 @@
   _URC_END_OF_STACK = 5,
   _URC_HANDLER_FOUND = 6,
   _URC_INSTALL_CONTEXT = 7,
-  _URC_CONTINUE_UNWIND = 8
+  _URC_CONTINUE_UNWIND = 8,
+#if _UNWIND_ARM_EHABI
+  _URC_FAILURE = 9 /* used by ARM EHABI */
+#endif
 } _Unwind_Reason_Code;
 
 typedef enum {
@@ -150,6 +163,15 @@
   _UVRSR_FAILED = 2
 } _Unwind_VRS_Result;
 
+#if _UNWIND_ARM_EHABI
+typedef uint32_t _Unwind_State;
+#define _US_VIRTUAL_UNWIND_FRAME  ((_Unwind_State)0)
+#define _US_UNWIND_FRAME_STARTING ((_Unwind_State)1)
+#define _US_UNWIND_FRAME_RESUME   ((_Unwind_State)2)
+#define _US_ACTION_MASK           ((_Unwind_State)3)
+#define _US_FORCE_UNWIND          ((_Unwind_State)8)
+#endif
+
 _Unwind_VRS_Result _Unwind_VRS_Get(struct _Unwind_Context *__context,
   _Unwind_VRS_RegClass __regclass,
   uint32_t __regno,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15883.48026.patch
Type: text/x-patch
Size: 1432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160215/b6935695/attachment-0001.bin>


More information about the cfe-commits mailing list