diff options
Diffstat (limited to 'gcc/ada/raise.c')
-rw-r--r-- | gcc/ada/raise.c | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/gcc/ada/raise.c b/gcc/ada/raise.c index 087448a4d50..a9841740d88 100644 --- a/gcc/ada/raise.c +++ b/gcc/ada/raise.c @@ -88,10 +88,20 @@ __gnat_unhandled_terminate () } /* Below is the code related to the integration of the GCC mechanism for - exception handling. */ + exception handling. Still work in progress. */ #include "unwind.h" +/* If the underlying GCC scheme for exception handling is SJLJ, the standard + propagation routine (_Unwind_RaiseException) is actually renamed using a + #define directive (see unwing-sjlj.c). We need a consistently named + interface to import from a-except, so stubs are defined here, at the end + of this file. */ + +_Unwind_Reason_Code +__gnat_Unwind_RaiseException PARAMS ((struct _Unwind_Exception *)); + + /* Exception Handling personality routine for Ada. ??? It is currently inspired from the one for C++, needs cleanups and @@ -597,21 +607,45 @@ __gnat_eh_personality (version, actions, exception_class, ue_header, context) } -#else /* IN_RTS - For eh personality routine */ +/* Stubs for the libgcc unwinding interface, to be imported by a-except. */ + +#ifdef __USING_SJLJ_EXCEPTIONS__ + +_Unwind_Reason_Code +__gnat_Unwind_RaiseException (e) + struct _Unwind_Exception *e; +{ + return _Unwind_SjLj_RaiseException (e); +} + +#else +/* __USING_SJLJ_EXCEPTIONS__ not defined */ + +_Unwind_Reason_Code +__gnat_Unwind_RaiseException (e) + struct _Unwind_Exception *e; +{ + return _Unwind_RaiseException (e); +} + +#endif + +#else +/* IN_RTS not defined */ /* The calls to the GCC runtime interface for exception raising are currently issued from a-except.adb, which is used by both the runtime library and the compiler. As the compiler binary is not linked against the GCC runtime library, we need a stub for this interface in the compiler case. */ +/* Since we don't link the compiler with a host libgcc, we should not be + using the GCC eh mechanism for the compiler and so expect this function + never to be called. */ _Unwind_Reason_Code -_Unwind_RaiseException (e) +__gnat_Unwind_RaiseException (e) struct _Unwind_Exception *e ATTRIBUTE_UNUSED; { - /* Since we don't link the compiler with a host libgcc, we should not be - using the GCC eh mechanism for the compiler and so expect this function - never to be called. */ abort (); } |