mirror-llvm-project/llvm
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
..
benchmarks [ADT] Add single-pass merge for ImmutableSet/ImmutableMap (#209807) 2026-07-21 12:33:28 +01:00
bindings [IR] Remove deprecated BranchInst (#212095) 2026-07-26 19:07:01 +02:00
cmake [Darwin] Improve ld64 based configs (#212329) 2026-07-28 09:22:37 -07:00
docs IR: Accept x86_fp80 and float as a long-double-type value (#210818) 2026-07-28 19:18:45 +00:00
examples
include [WebAssembly] Call EH personality function instead of Unwind_CallPersonality (#209282) 2026-07-28 20:05:45 -07:00
lib [WebAssembly] Call EH personality function instead of Unwind_CallPersonality (#209282) 2026-07-28 20:05:45 -07:00
projects
resources
runtimes [LLVM] Remove 'LLVM_LIBC_GPU_BUILD' logic (#211265) 2026-07-22 11:11:55 -05:00
test [WebAssembly] Call EH personality function instead of Unwind_CallPersonality (#209282) 2026-07-28 20:05:45 -07:00
tools [llubi] Add support for byte types (#200672) 2026-07-28 02:41:46 +08:00
unittests Triple: Add query for the default long double format (#211239) 2026-07-28 19:31:48 +00:00
utils [flang][openacc] Allow blank around ':' in generated clause parser with keyword (#212638) 2026-07-28 23:17:22 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [LLVM] Remove 'LLVM_LIBC_GPU_BUILD' logic (#211265) 2026-07-22 11:11:55 -05:00
CMakePresets.json
configure
CREDITS.TXT
LICENSE.TXT
Maintainers.md [LLVM][Maintainers] Volunteer for LoopUnroll (#207802) 2026-07-08 17:35:07 +00:00
README.txt
RELEASE_TESTERS.TXT

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.md for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.