diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-05-09 01:52:26 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-05-09 01:52:26 -0700 |
| commit | bcb534c295d5cc6fd63caa570cc08e6b148a507c (patch) | |
| tree | 0b17cb1e632d894f50f25e550d5113f232b0e877 /lib/libcxx/src/support/runtime | |
| parent | d9b00ee4ba48717ff6b306a6f9419e7b604ac04b (diff) | |
| parent | 74f52954b9cb40d59d80b839b45bb859146731a7 (diff) | |
| download | zig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.tar.gz zig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.zip | |
Merge branch 'llvm18'
Upgrades the LLVM, Clang, and LLD dependencies to LLVM 18.x
Related to #16270
Diffstat (limited to 'lib/libcxx/src/support/runtime')
11 files changed, 185 insertions, 366 deletions
diff --git a/lib/libcxx/src/support/runtime/exception_fallback.ipp b/lib/libcxx/src/support/runtime/exception_fallback.ipp index 3b2716d36f..18ff4b83d8 100644 --- a/lib/libcxx/src/support/runtime/exception_fallback.ipp +++ b/lib/libcxx/src/support/runtime/exception_fallback.ipp @@ -11,148 +11,83 @@ namespace std { -static constinit std::terminate_handler __terminate_handler = nullptr; +static constinit std::terminate_handler __terminate_handler = nullptr; static constinit std::unexpected_handler __unexpected_handler = nullptr; // libcxxrt provides implementations of these functions itself. -unexpected_handler -set_unexpected(unexpected_handler func) noexcept -{ +unexpected_handler set_unexpected(unexpected_handler func) noexcept { return __libcpp_atomic_exchange(&__unexpected_handler, func); } -unexpected_handler -get_unexpected() noexcept -{ - return __libcpp_atomic_load(&__unexpected_handler); -} +unexpected_handler get_unexpected() noexcept { return __libcpp_atomic_load(&__unexpected_handler); } -_LIBCPP_NORETURN -void unexpected() -{ - (*get_unexpected())(); - // unexpected handler should not return - terminate(); +_LIBCPP_NORETURN void unexpected() { + (*get_unexpected())(); + // unexpected handler should not return + terminate(); } -terminate_handler -set_terminate(terminate_handler func) noexcept -{ +terminate_handler set_terminate(terminate_handler func) noexcept { return __libcpp_atomic_exchange(&__terminate_handler, func); } -terminate_handler -get_terminate() noexcept -{ - return __libcpp_atomic_load(&__terminate_handler); -} +terminate_handler get_terminate() noexcept { return __libcpp_atomic_load(&__terminate_handler); } -_LIBCPP_NORETURN -void -terminate() noexcept -{ +_LIBCPP_NORETURN void terminate() noexcept { #ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try - { + try { #endif // _LIBCPP_HAS_NO_EXCEPTIONS - (*get_terminate())(); - // handler should not return - fprintf(stderr, "terminate_handler unexpectedly returned\n"); - ::abort(); + (*get_terminate())(); + // handler should not return + fprintf(stderr, "terminate_handler unexpectedly returned\n"); + ::abort(); #ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } - catch (...) - { - // handler should not throw exception - fprintf(stderr, "terminate_handler unexpectedly threw an exception\n"); - ::abort(); - } + } catch (...) { + // handler should not throw exception + fprintf(stderr, "terminate_handler unexpectedly threw an exception\n"); + ::abort(); + } #endif // _LIBCPP_HAS_NO_EXCEPTIONS } bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; } -int uncaught_exceptions() noexcept -{ +int uncaught_exceptions() noexcept { #warning uncaught_exception not yet implemented fprintf(stderr, "uncaught_exceptions not yet implemented\n"); ::abort(); } +exception::~exception() noexcept {} -exception::~exception() noexcept -{ -} - -const char* exception::what() const noexcept -{ - return "std::exception"; -} - -bad_exception::~bad_exception() noexcept -{ -} +const char* exception::what() const noexcept { return "std::exception"; } -const char* bad_exception::what() const noexcept -{ - return "std::bad_exception"; -} +bad_exception::~bad_exception() noexcept {} +const char* bad_exception::what() const noexcept { return "std::bad_exception"; } -bad_alloc::bad_alloc() noexcept -{ -} +bad_alloc::bad_alloc() noexcept {} -bad_alloc::~bad_alloc() noexcept -{ -} +bad_alloc::~bad_alloc() noexcept {} -const char* -bad_alloc::what() const noexcept -{ - return "std::bad_alloc"; -} +const char* bad_alloc::what() const noexcept { return "std::bad_alloc"; } -bad_array_new_length::bad_array_new_length() noexcept -{ -} +bad_array_new_length::bad_array_new_length() noexcept {} -bad_array_new_length::~bad_array_new_length() noexcept -{ -} +bad_array_new_length::~bad_array_new_length() noexcept {} -const char* -bad_array_new_length::what() const noexcept -{ - return "bad_array_new_length"; -} +const char* bad_array_new_length::what() const noexcept { return "bad_array_new_length"; } -bad_cast::bad_cast() noexcept -{ -} +bad_cast::bad_cast() noexcept {} -bad_typeid::bad_typeid() noexcept -{ -} +bad_typeid::bad_typeid() noexcept {} -bad_cast::~bad_cast() noexcept -{ -} +bad_cast::~bad_cast() noexcept {} -const char* -bad_cast::what() const noexcept -{ - return "std::bad_cast"; -} +const char* bad_cast::what() const noexcept { return "std::bad_cast"; } -bad_typeid::~bad_typeid() noexcept -{ -} +bad_typeid::~bad_typeid() noexcept {} -const char* -bad_typeid::what() const noexcept -{ - return "std::bad_typeid"; -} +const char* bad_typeid::what() const noexcept { return "std::bad_typeid"; } } // namespace std diff --git a/lib/libcxx/src/support/runtime/exception_glibcxx.ipp b/lib/libcxx/src/support/runtime/exception_glibcxx.ipp index e478ccbb6e..aa67cab6bc 100644 --- a/lib/libcxx/src/support/runtime/exception_glibcxx.ipp +++ b/lib/libcxx/src/support/runtime/exception_glibcxx.ipp @@ -8,25 +8,17 @@ //===----------------------------------------------------------------------===// #ifndef __GLIBCXX__ -#error header can only be used when targeting libstdc++ or libsupc++ +# error header can only be used when targeting libstdc++ or libsupc++ #endif namespace std { -bad_alloc::bad_alloc() noexcept -{ -} +bad_alloc::bad_alloc() noexcept {} -bad_array_new_length::bad_array_new_length() noexcept -{ -} +bad_array_new_length::bad_array_new_length() noexcept {} -bad_cast::bad_cast() noexcept -{ -} +bad_cast::bad_cast() noexcept {} -bad_typeid::bad_typeid() noexcept -{ -} +bad_typeid::bad_typeid() noexcept {} } // namespace std diff --git a/lib/libcxx/src/support/runtime/exception_libcxxabi.ipp b/lib/libcxx/src/support/runtime/exception_libcxxabi.ipp index ee15e437e6..df6bd6574b 100644 --- a/lib/libcxx/src/support/runtime/exception_libcxxabi.ipp +++ b/lib/libcxx/src/support/runtime/exception_libcxxabi.ipp @@ -8,20 +8,19 @@ //===----------------------------------------------------------------------===// #ifndef _LIBCPPABI_VERSION -#error this header can only be used with libc++abi +# error this header can only be used with libc++abi #endif namespace std { bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; } -int uncaught_exceptions() noexcept -{ -# if _LIBCPPABI_VERSION > 1001 - return __cxa_uncaught_exceptions(); -# else - return __cxa_uncaught_exception() ? 1 : 0; -# endif +int uncaught_exceptions() noexcept { +#if _LIBCPPABI_VERSION > 1001 + return __cxa_uncaught_exceptions(); +#else + return __cxa_uncaught_exception() ? 1 : 0; +#endif } } // namespace std diff --git a/lib/libcxx/src/support/runtime/exception_libcxxrt.ipp b/lib/libcxx/src/support/runtime/exception_libcxxrt.ipp index 62aa3229ed..f17fecc71e 100644 --- a/lib/libcxx/src/support/runtime/exception_libcxxrt.ipp +++ b/lib/libcxx/src/support/runtime/exception_libcxxrt.ipp @@ -8,18 +8,13 @@ //===----------------------------------------------------------------------===// #ifndef LIBCXXRT -#error this header may only be used when targeting libcxxrt +# error this header may only be used when targeting libcxxrt #endif namespace std { -bad_exception::~bad_exception() noexcept -{ -} +bad_exception::~bad_exception() noexcept {} -const char* bad_exception::what() const noexcept -{ - return "std::bad_exception"; -} +const char* bad_exception::what() const noexcept { return "std::bad_exception"; } } // namespace std diff --git a/lib/libcxx/src/support/runtime/exception_msvc.ipp b/lib/libcxx/src/support/runtime/exception_msvc.ipp index 0114d5adee..323cd9d180 100644 --- a/lib/libcxx/src/support/runtime/exception_msvc.ipp +++ b/lib/libcxx/src/support/runtime/exception_msvc.ipp @@ -8,21 +8,19 @@ //===----------------------------------------------------------------------===// #ifndef _LIBCPP_ABI_MICROSOFT -#error this header can only be used when targeting the MSVC ABI +# error this header can only be used when targeting the MSVC ABI #endif #include <stdio.h> #include <stdlib.h> extern "C" { -typedef void (__cdecl* terminate_handler)(); -_LIBCPP_CRT_FUNC terminate_handler __cdecl set_terminate( - terminate_handler _NewTerminateHandler) throw(); +typedef void(__cdecl* terminate_handler)(); +_LIBCPP_CRT_FUNC terminate_handler __cdecl set_terminate(terminate_handler _NewTerminateHandler) throw(); _LIBCPP_CRT_FUNC terminate_handler __cdecl _get_terminate(); -typedef void (__cdecl* unexpected_handler)(); -unexpected_handler __cdecl set_unexpected( - unexpected_handler _NewUnexpectedHandler) throw(); +typedef void(__cdecl* unexpected_handler)(); +unexpected_handler __cdecl set_unexpected(unexpected_handler _NewUnexpectedHandler) throw(); unexpected_handler __cdecl _get_unexpected(); int __cdecl __uncaught_exceptions(); @@ -30,134 +28,73 @@ int __cdecl __uncaught_exceptions(); namespace std { -unexpected_handler -set_unexpected(unexpected_handler func) noexcept { - return ::set_unexpected(func); -} +unexpected_handler set_unexpected(unexpected_handler func) noexcept { return ::set_unexpected(func); } -unexpected_handler get_unexpected() noexcept { - return ::_get_unexpected(); -} +unexpected_handler get_unexpected() noexcept { return ::_get_unexpected(); } -_LIBCPP_NORETURN -void unexpected() { - (*get_unexpected())(); - // unexpected handler should not return - terminate(); +_LIBCPP_NORETURN void unexpected() { + (*get_unexpected())(); + // unexpected handler should not return + terminate(); } -terminate_handler set_terminate(terminate_handler func) noexcept { - return ::set_terminate(func); -} +terminate_handler set_terminate(terminate_handler func) noexcept { return ::set_terminate(func); } -terminate_handler get_terminate() noexcept { - return ::_get_terminate(); -} +terminate_handler get_terminate() noexcept { return ::_get_terminate(); } -_LIBCPP_NORETURN -void terminate() noexcept -{ +_LIBCPP_NORETURN void terminate() noexcept { #ifndef _LIBCPP_HAS_NO_EXCEPTIONS - try - { + try { #endif // _LIBCPP_HAS_NO_EXCEPTIONS - (*get_terminate())(); - // handler should not return - fprintf(stderr, "terminate_handler unexpectedly returned\n"); - ::abort(); + (*get_terminate())(); + // handler should not return + fprintf(stderr, "terminate_handler unexpectedly returned\n"); + ::abort(); #ifndef _LIBCPP_HAS_NO_EXCEPTIONS - } - catch (...) - { - // handler should not throw exception - fprintf(stderr, "terminate_handler unexpectedly threw an exception\n"); - ::abort(); - } + } catch (...) { + // handler should not throw exception + fprintf(stderr, "terminate_handler unexpectedly threw an exception\n"); + ::abort(); + } #endif // _LIBCPP_HAS_NO_EXCEPTIONS } bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; } -int uncaught_exceptions() noexcept { - return __uncaught_exceptions(); -} +int uncaught_exceptions() noexcept { return __uncaught_exceptions(); } #if !defined(_LIBCPP_ABI_VCRUNTIME) -bad_cast::bad_cast() noexcept -{ -} +bad_cast::bad_cast() noexcept {} -bad_cast::~bad_cast() noexcept -{ -} +bad_cast::~bad_cast() noexcept {} -const char * -bad_cast::what() const noexcept -{ - return "std::bad_cast"; -} +const char* bad_cast::what() const noexcept { return "std::bad_cast"; } -bad_typeid::bad_typeid() noexcept -{ -} +bad_typeid::bad_typeid() noexcept {} -bad_typeid::~bad_typeid() noexcept -{ -} +bad_typeid::~bad_typeid() noexcept {} -const char * -bad_typeid::what() const noexcept -{ - return "std::bad_typeid"; -} +const char* bad_typeid::what() const noexcept { return "std::bad_typeid"; } -exception::~exception() noexcept -{ -} +exception::~exception() noexcept {} -const char* exception::what() const noexcept -{ - return "std::exception"; -} +const char* exception::what() const noexcept { return "std::exception"; } +bad_exception::~bad_exception() noexcept {} -bad_exception::~bad_exception() noexcept -{ -} +const char* bad_exception::what() const noexcept { return "std::bad_exception"; } -const char* bad_exception::what() const noexcept -{ - return "std::bad_exception"; -} +bad_alloc::bad_alloc() noexcept {} +bad_alloc::~bad_alloc() noexcept {} -bad_alloc::bad_alloc() noexcept -{ -} +const char* bad_alloc::what() const noexcept { return "std::bad_alloc"; } -bad_alloc::~bad_alloc() noexcept -{ -} +bad_array_new_length::bad_array_new_length() noexcept {} -const char* -bad_alloc::what() const noexcept -{ - return "std::bad_alloc"; -} +bad_array_new_length::~bad_array_new_length() noexcept {} -bad_array_new_length::bad_array_new_length() noexcept -{ -} - -bad_array_new_length::~bad_array_new_length() noexcept -{ -} - -const char* -bad_array_new_length::what() const noexcept -{ - return "bad_array_new_length"; -} +const char* bad_array_new_length::what() const noexcept { return "bad_array_new_length"; } #endif // !_LIBCPP_ABI_VCRUNTIME } // namespace std diff --git a/lib/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp b/lib/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp index 33aa94502b..bdb17b9996 100644 --- a/lib/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp +++ b/lib/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp @@ -8,66 +8,57 @@ //===----------------------------------------------------------------------===// #ifndef HAVE_DEPENDENT_EH_ABI -#error this header may only be used with libc++abi or libcxxrt +# 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() 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(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; +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()) -{ -} +exception_ptr exception_ptr::__from_native_exception_pointer(void* __e) noexcept { + exception_ptr ptr; + ptr.__ptr_ = __e; + __cxa_increment_exception_refcount(ptr.__ptr_); -nested_exception::~nested_exception() noexcept -{ + return ptr; } -_LIBCPP_NORETURN -void -nested_exception::rethrow_nested() const -{ - if (__ptr_ == nullptr) - terminate(); - rethrow_exception(__ptr_); +nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {} + +nested_exception::~nested_exception() noexcept {} + +_LIBCPP_NORETURN void nested_exception::rethrow_nested() const { + if (__ptr_ == nullptr) + terminate(); + rethrow_exception(__ptr_); } -exception_ptr current_exception() noexcept -{ - // be nicer if there was a constructor that took a ptr, then - // this whole function would be just: - // return exception_ptr(__cxa_current_primary_exception()); - exception_ptr ptr; - ptr.__ptr_ = __cxa_current_primary_exception(); - return ptr; +exception_ptr current_exception() noexcept { + // be nicer if there was a constructor that took a ptr, then + // this whole function would be just: + // return exception_ptr(__cxa_current_primary_exception()); + exception_ptr ptr; + ptr.__ptr_ = __cxa_current_primary_exception(); + return ptr; } -_LIBCPP_NORETURN -void rethrow_exception(exception_ptr p) -{ - __cxa_rethrow_primary_exception(p.__ptr_); - // if p.__ptr_ is NULL, above returns so we terminate - terminate(); +_LIBCPP_NORETURN void rethrow_exception(exception_ptr p) { + __cxa_rethrow_primary_exception(p.__ptr_); + // if p.__ptr_ is NULL, above returns so we terminate + terminate(); } } // namespace std diff --git a/lib/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp b/lib/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp index 983a08808d..6dad248f9e 100644 --- a/lib/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp +++ b/lib/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp @@ -18,60 +18,51 @@ namespace std { -namespace __exception_ptr -{ +namespace __exception_ptr { -struct exception_ptr -{ - void* __ptr_; +struct exception_ptr { + void* __ptr_; - exception_ptr(const exception_ptr&) noexcept; - exception_ptr& operator=(const exception_ptr&) noexcept; - ~exception_ptr() noexcept; + explicit exception_ptr(void*) noexcept; + exception_ptr(const exception_ptr&) noexcept; + exception_ptr& operator=(const exception_ptr&) noexcept; + ~exception_ptr() noexcept; }; -} +} // namespace __exception_ptr _LIBCPP_NORETURN void rethrow_exception(__exception_ptr::exception_ptr); -exception_ptr::~exception_ptr() noexcept -{ - reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr(); -} +exception_ptr::~exception_ptr() noexcept { reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr(); } -exception_ptr::exception_ptr(const exception_ptr& other) noexcept - : __ptr_(other.__ptr_) -{ - new (reinterpret_cast<void*>(this)) __exception_ptr::exception_ptr( - reinterpret_cast<const __exception_ptr::exception_ptr&>(other)); +exception_ptr::exception_ptr(const exception_ptr& other) noexcept : __ptr_(other.__ptr_) { + new (reinterpret_cast<void*>(this)) + __exception_ptr::exception_ptr(reinterpret_cast<const __exception_ptr::exception_ptr&>(other)); } -exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept -{ - *reinterpret_cast<__exception_ptr::exception_ptr*>(this) = - reinterpret_cast<const __exception_ptr::exception_ptr&>(other); - return *this; +exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept { + *reinterpret_cast<__exception_ptr::exception_ptr*>(this) = + reinterpret_cast<const __exception_ptr::exception_ptr&>(other); + return *this; } -nested_exception::nested_exception() noexcept - : __ptr_(current_exception()) -{ +exception_ptr exception_ptr::__from_native_exception_pointer(void* __e) noexcept { + exception_ptr ptr{}; + new (reinterpret_cast<void*>(&ptr)) __exception_ptr::exception_ptr(__e); + + return ptr; } +nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {} -_LIBCPP_NORETURN -void -nested_exception::rethrow_nested() const -{ - if (__ptr_ == nullptr) - terminate(); - rethrow_exception(__ptr_); +_LIBCPP_NORETURN void nested_exception::rethrow_nested() const { + if (__ptr_ == nullptr) + terminate(); + rethrow_exception(__ptr_); } -_LIBCPP_NORETURN -void rethrow_exception(exception_ptr p) -{ - rethrow_exception(reinterpret_cast<__exception_ptr::exception_ptr&>(p)); +_LIBCPP_NORETURN void rethrow_exception(exception_ptr p) { + rethrow_exception(reinterpret_cast<__exception_ptr::exception_ptr&>(p)); } } // namespace std diff --git a/lib/libcxx/src/support/runtime/exception_pointer_msvc.ipp b/lib/libcxx/src/support/runtime/exception_pointer_msvc.ipp index 9e7f392e76..b87742b32d 100644 --- a/lib/libcxx/src/support/runtime/exception_pointer_msvc.ipp +++ b/lib/libcxx/src/support/runtime/exception_pointer_msvc.ipp @@ -19,17 +19,14 @@ _LIBCPP_CRT_FUNC bool __cdecl __ExceptionPtrToBool(const void*); _LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrSwap(void*, void*); _LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCurrentException(void*); [[noreturn]] _LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrRethrow(const void*); -_LIBCPP_CRT_FUNC void __cdecl -__ExceptionPtrCopyException(void*, const void*, const void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCopyException(void*, const void*, const void*); namespace std { exception_ptr::exception_ptr() noexcept { __ExceptionPtrCreate(this); } exception_ptr::exception_ptr(nullptr_t) noexcept { __ExceptionPtrCreate(this); } -exception_ptr::exception_ptr(const exception_ptr& __other) noexcept { - __ExceptionPtrCopy(this, &__other); -} +exception_ptr::exception_ptr(const exception_ptr& __other) noexcept { __ExceptionPtrCopy(this, &__other); } exception_ptr& exception_ptr::operator=(const exception_ptr& __other) noexcept { __ExceptionPtrAssign(this, &__other); return *this; @@ -43,18 +40,13 @@ exception_ptr& exception_ptr::operator=(nullptr_t) noexcept { exception_ptr::~exception_ptr() noexcept { __ExceptionPtrDestroy(this); } -exception_ptr::operator bool() const noexcept { - return __ExceptionPtrToBool(this); -} +exception_ptr::operator bool() const noexcept { return __ExceptionPtrToBool(this); } bool operator==(const exception_ptr& __x, const exception_ptr& __y) noexcept { return __ExceptionPtrCompare(&__x, &__y); } - -void swap(exception_ptr& lhs, exception_ptr& rhs) noexcept { - __ExceptionPtrSwap(&rhs, &lhs); -} +void swap(exception_ptr& lhs, exception_ptr& rhs) noexcept { __ExceptionPtrSwap(&rhs, &lhs); } exception_ptr __copy_exception_ptr(void* __except, const void* __ptr) { exception_ptr __ret = nullptr; @@ -69,15 +61,13 @@ exception_ptr current_exception() noexcept { return __ret; } -_LIBCPP_NORETURN -void rethrow_exception(exception_ptr p) { __ExceptionPtrRethrow(&p); } +_LIBCPP_NORETURN void rethrow_exception(exception_ptr p) { __ExceptionPtrRethrow(&p); } nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {} nested_exception::~nested_exception() noexcept {} -_LIBCPP_NORETURN -void nested_exception::rethrow_nested() const { +_LIBCPP_NORETURN void nested_exception::rethrow_nested() const { if (__ptr_ == nullptr) terminate(); rethrow_exception(__ptr_); diff --git a/lib/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp b/lib/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp index 9e8ec04e11..e12b0caf41 100644 --- a/lib/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp +++ b/lib/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp @@ -12,46 +12,40 @@ namespace std { -exception_ptr::~exception_ptr() noexcept -{ -# warning exception_ptr not yet implemented +exception_ptr::~exception_ptr() noexcept { +#warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); ::abort(); } -exception_ptr::exception_ptr(const exception_ptr& other) noexcept - : __ptr_(other.__ptr_) -{ -# warning exception_ptr not yet implemented +exception_ptr::exception_ptr(const exception_ptr& other) noexcept : __ptr_(other.__ptr_) { +#warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); ::abort(); } -exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept -{ -# warning exception_ptr not yet implemented +exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept { +#warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); ::abort(); } -nested_exception::nested_exception() noexcept - : __ptr_(current_exception()) -{ +exception_ptr exception_ptr::__from_native_exception_pointer(void *__e) noexcept { +#warning exception_ptr not yet implemented + fprintf(stderr, "exception_ptr not yet implemented\n"); + ::abort(); } +nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {} + #if !defined(__GLIBCXX__) -nested_exception::~nested_exception() noexcept -{ -} +nested_exception::~nested_exception() noexcept {} #endif -_LIBCPP_NORETURN -void -nested_exception::rethrow_nested() const -{ -# warning exception_ptr not yet implemented +_LIBCPP_NORETURN void nested_exception::rethrow_nested() const { +#warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); ::abort(); #if 0 @@ -61,17 +55,14 @@ nested_exception::rethrow_nested() const #endif // FIXME } -exception_ptr current_exception() noexcept -{ -# warning exception_ptr not yet implemented +exception_ptr current_exception() noexcept { +#warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); ::abort(); } -_LIBCPP_NORETURN -void rethrow_exception(exception_ptr p) -{ -# warning exception_ptr not yet implemented +_LIBCPP_NORETURN void rethrow_exception(exception_ptr p) { +#warning exception_ptr not yet implemented fprintf(stderr, "exception_ptr not yet implemented\n"); ::abort(); } diff --git a/lib/libcxx/src/support/runtime/stdexcept_default.ipp b/lib/libcxx/src/support/runtime/stdexcept_default.ipp index 99d3045356..1f47a0325d 100644 --- a/lib/libcxx/src/support/runtime/stdexcept_default.ipp +++ b/lib/libcxx/src/support/runtime/stdexcept_default.ipp @@ -9,9 +9,8 @@ #include "../../include/refstring.h" /* For _LIBCPPABI_VERSION */ -#if !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) && \ - (defined(LIBCXX_BUILDING_LIBCXXABI) || defined(LIBCXXRT)) -#include <cxxabi.h> +#if !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) && (defined(LIBCXX_BUILDING_LIBCXXABI) || defined(LIBCXXRT)) +# include <cxxabi.h> #endif static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char*), ""); @@ -34,8 +33,7 @@ runtime_error::runtime_error(const string& msg) : __imp_(msg.c_str()) {} runtime_error::runtime_error(const char* msg) : __imp_(msg) {} -runtime_error::runtime_error(const runtime_error& re) noexcept - : __imp_(re.__imp_) {} +runtime_error::runtime_error(const runtime_error& re) noexcept : __imp_(re.__imp_) {} runtime_error& runtime_error::operator=(const runtime_error& re) noexcept { __imp_ = re.__imp_; diff --git a/lib/libcxx/src/support/runtime/stdexcept_vcruntime.ipp b/lib/libcxx/src/support/runtime/stdexcept_vcruntime.ipp index db9097d097..e6ecbf782f 100644 --- a/lib/libcxx/src/support/runtime/stdexcept_vcruntime.ipp +++ b/lib/libcxx/src/support/runtime/stdexcept_vcruntime.ipp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #ifndef _LIBCPP_ABI_VCRUNTIME -#error This file may only be used when deferring to vcruntime +# error This file may only be used when deferring to vcruntime #endif namespace std { |
