| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef HAVE_DEPENDENT_EH_ABI |
| | #error this header may only be used with libc++abi or libcxxrt |
| | #endif |
| |
|
| | namespace std { |
| |
|
| | exception_ptr::~exception_ptr() _NOEXCEPT { |
| | __cxa_decrement_exception_refcount(__ptr_); |
| | } |
| |
|
| | exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT |
| | : __ptr_(other.__ptr_) |
| | { |
| | __cxa_increment_exception_refcount(__ptr_); |
| | } |
| |
|
| | exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT |
| | { |
| | if (__ptr_ != other.__ptr_) |
| | { |
| | __cxa_increment_exception_refcount(other.__ptr_); |
| | __cxa_decrement_exception_refcount(__ptr_); |
| | __ptr_ = other.__ptr_; |
| | } |
| | return *this; |
| | } |
| |
|
| | nested_exception::nested_exception() _NOEXCEPT |
| | : __ptr_(current_exception()) |
| | { |
| | } |
| |
|
| | nested_exception::~nested_exception() _NOEXCEPT |
| | { |
| | } |
| |
|
| | _LIBCUDACXX_NORETURN |
| | void |
| | nested_exception::rethrow_nested() const |
| | { |
| | if (__ptr_ == nullptr) |
| | terminate(); |
| | rethrow_exception(__ptr_); |
| | } |
| |
|
| | exception_ptr current_exception() _NOEXCEPT |
| | { |
| | |
| | |
| | |
| | exception_ptr ptr; |
| | ptr.__ptr_ = __cxa_current_primary_exception(); |
| | return ptr; |
| | } |
| |
|
| | _LIBCUDACXX_NORETURN |
| | void rethrow_exception(exception_ptr p) |
| | { |
| | __cxa_rethrow_primary_exception(p.__ptr_); |
| | |
| | terminate(); |
| | } |
| |
|
| | } |
| |
|