hmelder wrote:

There is also some work to be done to support other personality functions in 
WebAssembly. Basic code generation with the wrong personality function works 
with [this](https://github.com/llvm/llvm-project/pull/171038) patch.

1. Clang emits `_Unwind_CallPersonality` (defined in 
[libunwind/src/Unwind-wasm.c](https://github.com/llvm/llvm-project/blob/80ec43d455a5e47ba005112cd2b2c447bb40c42c/libunwind/src/Unwind-wasm.c#L58))
 which always calls `__gxx_personality_wasm0`.
2. WebAssembly catchpads are emitted based on the return value of 
`isWasmPersonality`.
3. WasmEHPrepare hard-codes and reports a fatal error if the personality 
function is not `__gxx_wasm_personality_v0`
https://github.com/llvm/llvm-project/blob/80ec43d455a5e47ba005112cd2b2c447bb40c42c/llvm/lib/CodeGen/WasmEHPrepare.cpp#L238-L244


The personality `__gxx_personality_wasm0` is implemented in 
[libcxxabi/src/cxa_personality.cpp](https://github.com/llvm/llvm-project/blob/80ec43d455a5e47ba005112cd2b2c447bb40c42c/libcxxabi/src/cxa_personality.cpp#L1019
).

I would like to avoid defining two new personality functions for ObjC and 
ObjCXX on WASM. Can't we just differentiate and emit code based on the target 
triple?



https://github.com/llvm/llvm-project/pull/169043
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to