[clang] [llvm] [WebAssembly] Implement an alternative translation for -wasm-enable-sjlj (PR #84137)

Heejin Ahn via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 13 15:59:53 PDT 2024


================
@@ -999,25 +1017,43 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runOnModule(Module &M) {
       // Register __wasm_longjmp function, which calls __builtin_wasm_longjmp.
       FunctionType *FTy = FunctionType::get(
           IRB.getVoidTy(), {Int8PtrTy, IRB.getInt32Ty()}, false);
-      WasmLongjmpF = getEmscriptenFunction(FTy, "__wasm_longjmp", &M);
+      if (EnableWasmAltSjLj) {
+        WasmLongjmpF = getEmscriptenFunction(FTy, "__wasm_sjlj_longjmp", &M);
----------------
aheejin wrote:

I think we discussed this in the emscripten PR.

https://github.com/llvm/llvm-project/pull/84137


More information about the cfe-commits mailing list