mirror-llvm-project/libcxxabi/src
Demetrius Kanios 1d4e04f7a7
[WebAssembly] Call EH personality function instead of Unwind_CallPersonality (#209282)
On Wasm, it's not currently possibly to change which `personality` is
attached to a given IR function. This is primarily because no matter
what `personality` is attached, codegen creates a call to a
`Unwind_CallPersonality` wrapper hard-coded to call c++abi's
personality.

In order to allow alternative personalities without introducing bloat at
each personality call site, this PR adjusts the ABI of the personality
on Wasm. `Unwind_CallPersonality` is moved to `libcxxabi` under the name
`__gxx_wasm_personality_v0`, with the "real" personality code renamed
`__gxx_personality_imp` and called by `__gxx_wasm_personality_v0` (after
resetting the landing pad context).

The signature of EH personalities on Wasm is now `int personality(void*
exception_object)` (where the int return is `_Unwind_Reason_Code` and
the `void*` is `_Unwind_Exception*`), and personalities are expected to
`__wasm_lpad_context.selector = 0;`.

Based on #175202
2026-07-28 20:05:45 -07:00
..
demangle [Demangle] Guard DEMANGLE_ABI and add missing annotation (#202920) 2026-06-11 02:48:04 -07:00
vendor/apple
abort_message.cpp
abort_message.h [libc++abi][NFC] Use C++11 spelling of [[noreturn]] (#207344) 2026-07-10 15:47:09 +02:00
aix_state_tab_eh.inc
CMakeLists.txt [libcxxabi] Don't enable -fvisibility=hidden on Windows (#207943) 2026-07-07 16:16:36 +03:00
cxa_aux_runtime.cpp [libc++abi][NFC] Use C++11 spelling of [[noreturn]] (#207344) 2026-07-10 15:47:09 +02:00
cxa_default_handlers.cpp [libc++abi][NFC] Use C++11 spelling of [[noreturn]] (#207344) 2026-07-10 15:47:09 +02:00
cxa_demangle.cpp
cxa_exception.cpp [libc++abi][NFC] Use C++11 spelling of [[noreturn]] (#207344) 2026-07-10 15:47:09 +02:00
cxa_exception.h [runtimes][PAC] Harden unwinding when possible (#143230) 2025-10-20 09:57:45 -07:00
cxa_exception_storage.cpp
cxa_guard.cpp
cxa_guard_impl.h [libc++] Remove _LIBCPP_CONSTINIT (#171802) 2026-01-20 12:51:43 +01:00
cxa_handlers.cpp [libc++abi][NFC] Use C++11 spelling of [[noreturn]] (#207344) 2026-07-10 15:47:09 +02:00
cxa_handlers.h [libc++abi][NFC] Use C++11 spelling of [[noreturn]] (#207344) 2026-07-10 15:47:09 +02:00
cxa_noexception.cpp
cxa_personality.cpp [WebAssembly] Call EH personality function instead of Unwind_CallPersonality (#209282) 2026-07-28 20:05:45 -07:00
cxa_thread_atexit.cpp [libc++] Enable -Wmissing-prototypes (#116261) 2025-12-16 11:25:07 +01:00
cxa_vector.cpp [libc++abi][NFC] Use C++11 spelling of [[noreturn]] (#207344) 2026-07-10 15:47:09 +02:00
cxa_virtual.cpp [libc++abi][NFC] Use C++11 spelling of [[noreturn]] (#207344) 2026-07-10 15:47:09 +02:00
fallback_malloc.cpp [libc++] Remove _LIBCPP_CONSTINIT (#171802) 2026-01-20 12:51:43 +01:00
fallback_malloc.h
private_typeinfo.cpp [libc++abi][NFC] Avoid out parameter in dyn_cast_get_derived_info (#207326) 2026-07-03 20:41:30 +02:00
private_typeinfo.h Prepare libcxx and libcxxabi for pointer field protection. 2026-03-25 15:51:35 -07:00
stdlib_exception.cpp
stdlib_new_delete.cpp [libc++] Partially revert #208330 (#209928) 2026-07-16 08:15:30 -04:00
stdlib_stdexcept.cpp
stdlib_typeinfo.cpp