[libcxx-commits] [libcxx] [libcxxabi] [libc++] [libc++abi] Initialize exception directly in make_exception_ptr if __cxa_init_primary_exception is available in ABI-library (PR #65534)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 5 10:58:51 PST 2023


================
@@ -34,6 +35,29 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept
     return *this;
 }
 
+#  if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
+void *exception_ptr::__init_native_exception(size_t size, type_info* tinfo, void (_LIBCXX_DTOR_FUNC* dest)(void*)) noexcept
----------------
ldionne wrote:

Separately from the above comment, I actually wonder if we should be defining these methods in the dylib at all. Is there a reason why we're not simply calling `__cxa_allocate_exception` and `__cxa_init_primary_exception` directly from the headers?

https://github.com/llvm/llvm-project/pull/65534


More information about the libcxx-commits mailing list