Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/compiler_rt/dist/lib/builtins Merge compile...



details:   https://anonhg.NetBSD.org/src/rev/86ff72c57be1
branches:  trunk
changeset: 343814:86ff72c57be1
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat Feb 27 19:05:27 2016 +0000

description:
Merge compiler-rt-259194.

diffstat:

 sys/external/bsd/compiler_rt/dist/lib/builtins/gcc_personality_v0.c |  61 +--------
 1 files changed, 11 insertions(+), 50 deletions(-)

diffs (103 lines):

diff -r 9d2d5df76314 -r 86ff72c57be1 sys/external/bsd/compiler_rt/dist/lib/builtins/gcc_personality_v0.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/gcc_personality_v0.c       Sat Feb 27 18:59:29 2016 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/gcc_personality_v0.c       Sat Feb 27 19:05:27 2016 +0000
@@ -11,47 +11,7 @@
 
 #include "int_lib.h"
 
-/*
- * _Unwind_* stuff based on C++ ABI public documentation
- * http://refspecs.freestandards.org/abi-eh-1.21.html
- */
-
-typedef enum {
-    _URC_NO_REASON = 0,
-    _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
-    _URC_FATAL_PHASE2_ERROR = 2,
-    _URC_FATAL_PHASE1_ERROR = 3,
-    _URC_NORMAL_STOP = 4,
-    _URC_END_OF_STACK = 5,
-    _URC_HANDLER_FOUND = 6,
-    _URC_INSTALL_CONTEXT = 7,
-    _URC_CONTINUE_UNWIND = 8
-} _Unwind_Reason_Code;
-
-typedef enum {
-    _UA_SEARCH_PHASE = 1,
-    _UA_CLEANUP_PHASE = 2,
-    _UA_HANDLER_FRAME = 4,
-    _UA_FORCE_UNWIND = 8,
-    _UA_END_OF_STACK = 16
-} _Unwind_Action;
-
-typedef struct _Unwind_Context* _Unwind_Context_t;
-
-struct _Unwind_Exception {
-    uint64_t                exception_class;
-    void                    (*exception_cleanup)(_Unwind_Reason_Code reason, 
-                                                 struct _Unwind_Exception* exc);
-    uintptr_t                private_1;    
-    uintptr_t                private_2;    
-};
-
-COMPILER_RT_ABI  const uint8_t*    _Unwind_GetLanguageSpecificData(_Unwind_Context_t c);
-COMPILER_RT_ABI  void              _Unwind_SetGR(_Unwind_Context_t c, int i, uintptr_t n);
-COMPILER_RT_ABI  void              _Unwind_SetIP(_Unwind_Context_t, uintptr_t new_value);
-COMPILER_RT_ABI  uintptr_t         _Unwind_GetIP(_Unwind_Context_t context);
-COMPILER_RT_ABI  uintptr_t         _Unwind_GetRegionStart(_Unwind_Context_t context);
-
+#include <unwind.h>
 
 /*
  * Pointer encodings documented at:
@@ -181,16 +141,17 @@
  * throw through a C function compiled with -fexceptions.
  */
 #if __USING_SJLJ_EXCEPTIONS__
-// the setjump-longjump based exceptions personality routine has a different name
+/* the setjump-longjump based exceptions personality routine has a
+ * different name */
 COMPILER_RT_ABI _Unwind_Reason_Code
 __gcc_personality_sj0(int version, _Unwind_Action actions,
          uint64_t exceptionClass, struct _Unwind_Exception* exceptionObject,
-         _Unwind_Context_t context)
+         struct _Unwind_Context *context)
 #else
 COMPILER_RT_ABI _Unwind_Reason_Code
 __gcc_personality_v0(int version, _Unwind_Action actions,
          uint64_t exceptionClass, struct _Unwind_Exception* exceptionObject,
-         _Unwind_Context_t context)
+         struct _Unwind_Context *context)
 #endif
 {
     /* Since C does not have catch clauses, there is nothing to do during */
@@ -199,7 +160,7 @@
         return _URC_CONTINUE_UNWIND;
         
     /* There is nothing to do if there is no LSDA for this frame. */
-    const uint8_t* lsda = _Unwind_GetLanguageSpecificData(context);
+    const uint8_t* lsda = (uint8_t*)_Unwind_GetLanguageSpecificData(context);
     if ( lsda == (uint8_t*) 0 )
         return _URC_CONTINUE_UNWIND;
 
@@ -234,15 +195,15 @@
              * Set Instruction Pointer to so we re-enter function 
              * at landing pad. The landing pad is created by the compiler
              * to take two parameters in registers.
-            */
-            _Unwind_SetGR(context, __builtin_eh_return_data_regno(0), 
-                                                (uintptr_t)exceptionObject);
+             */
+            _Unwind_SetGR(context, __builtin_eh_return_data_regno(0),
+                          (uintptr_t)exceptionObject);
             _Unwind_SetGR(context, __builtin_eh_return_data_regno(1), 0);
-            _Unwind_SetIP(context, funcStart+landingPad);
+            _Unwind_SetIP(context, (funcStart + landingPad));
             return _URC_INSTALL_CONTEXT;
         }
     }
-    
+
     /* No landing pad found, continue unwinding. */
     return _URC_CONTINUE_UNWIND;
 }



Home | Main Index | Thread Index | Old Index