[clang] [WebAssembly] Generate __clang_call_terminate for Emscripten EH (PR #129020)
Derek Schuff via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 27 08:31:58 PST 2025
================
@@ -5150,9 +5150,14 @@ WebAssemblyCXXABI::emitTerminateForUnexpectedException(CodeGenFunction &CGF,
// Itanium ABI calls __clang_call_terminate(), which __cxa_begin_catch() on
// the violating exception to mark it handled, but it is currently hard to do
// with wasm EH instruction structure with catch/catch_all, we just call
- // std::terminate and ignore the violating exception as in CGCXXABI.
+ // std::terminate and ignore the violating exception as in CGCXXABI in Wasm EH
+ // and calls __clang_call_terminate only in Emscripten EH.
// TODO Consider code transformation that makes calling __clang_call_terminate
- // possible.
+ // in Wasm EH possible.
+ if (Exn && !EHPersonality::get(CGF).isWasmPersonality()) {
----------------
dschuff wrote:
I assume that `isWasmPersonality()` is false when using emscripten EH; out of curiosity, what is the value of `EHPersonality` in that case?
https://github.com/llvm/llvm-project/pull/129020
More information about the cfe-commits
mailing list