[libcxx-commits] [libcxxabi] [libcxx] [libcxxabi] Dont throw in make exception ptr if __cxa_init_primary_exception is available (PR #65534)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Oct 12 16:34:38 PDT 2023
================
@@ -36,13 +36,19 @@ class type_info; // forward declaration
// runtime routines use C calling conventions, but are in __cxxabiv1 namespace
namespace __cxxabiv1 {
+
+struct __cxa_exception;
+
extern "C" {
// 2.4.2 Allocating the Exception Object
extern _LIBCXXABI_FUNC_VIS void *
__cxa_allocate_exception(size_t thrown_size) throw();
extern _LIBCXXABI_FUNC_VIS void
__cxa_free_exception(void *thrown_exception) throw();
+// This function is an llvm extension
+extern _LIBCXXABI_FUNC_VIS __cxa_exception*
+__cxa_init_primary_exception(void* object, std::type_info* tinfo, void(_LIBCXXABI_DTOR_FUNC* dest)(void*)) throw();
----------------
ldionne wrote:
Actually, I would like to have the opinion of some other folks on this first. We generally try to keep libc++abi close to the specification and I'm really unsure about adding an "LLVM extension".
@rjmccall @MaskRay Do you have an opinion about this patch? I am a bit wary of adding extensions to the Itanium C++ ABI in libc++abi.
https://github.com/llvm/llvm-project/pull/65534
More information about the libcxx-commits
mailing list