/// Called by __cxa_rethrow(). _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) { #if LIBCXXABI_ARM_EHABI _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), " "private_1=%ld\n", exception_object, (long)exception_object->unwinder_cache.reserved1); #else _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), " "private_1=%ld\n", exception_object, (long)exception_object->private_1); #endif #if LIBCXXABI_ARM_EHABI // _Unwind_RaiseException on EHABI will always set the reserved1 field to 0, // which is in the same position as private_1 below. return _Unwind_RaiseException(exception_object); #else // If this is non-forced and a stopping place was found, then this is a // re-throw. // Call _Unwind_RaiseException() as if this was a new exception if (exception_object->private_1 == 0) { return _Unwind_RaiseException(exception_object); // Will return if there is no catch clause, so that __cxa_rethrow can call // std::terminate(). } // Call through to _Unwind_Resume() which distiguishes between forced and // regular exceptions. _Unwind_Resume(exception_object); _LIBUNWIND_ABORT("_Unwind_Resume_or_Rethrow() called _Unwind_RaiseException()" " which unexpectedly returned"); #endif }
void __attribute__((nonnull)) __cilkrts_gcc_rethrow(__cilkrts_stack_frame *sf) { #ifdef __CYGWIN__ // Cygwin doesn't support exceptions, so _Unwind_Resume isn't available // Which means we can't support exceptions either __cilkrts_bug("The Cygwin implementation of the Intel Cilk Plus runtime doesn't support exceptions\n"); #else if (sf->except_data) { #if CILK_LIB_DEBUG CILK_ASSERT(std::uncaught_exception()); #endif _Unwind_Resume ((_Unwind_Exception *)sf->except_data); } else { throw; } #endif // __CYGWIN__ }