================
@@ -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()) {
----------------
aheejin wrote:

I didn't change anything in this case, and I checked now, and it is 
`GNU_CPlusPlus` defined here:
https://github.com/llvm/llvm-project/blob/f3b18491e840c23dfe25e399ddf6475425481835/clang/lib/CodeGen/CGCleanup.h#L680

`EHPersonality::isWasmPersonality()` returns true when it is 
`GNU_Wasm_CPlusPlus`:
https://github.com/llvm/llvm-project/blob/f3b18491e840c23dfe25e399ddf6475425481835/clang/lib/CodeGen/CGCleanup.h#L701

https://github.com/llvm/llvm-project/pull/129020
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to