[llvm] ba38b72 - [WebAssembly] Allow Wasm EH with Emscripten SjLj

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 13:27:54 PDT 2021


Author: Heejin Ahn
Date: 2021-05-12T13:27:04-07:00
New Revision: ba38b72ec2833bf8c54829a0fd7a8c968e6260d4

URL: https://github.com/llvm/llvm-project/commit/ba38b72ec2833bf8c54829a0fd7a8c968e6260d4
DIFF: https://github.com/llvm/llvm-project/commit/ba38b72ec2833bf8c54829a0fd7a8c968e6260d4.diff

LOG: [WebAssembly] Allow Wasm EH with Emscripten SjLj

We explicitly made it error out in D101403, out of a good intention that
the error message will make people less confusing. Turns out, we weren't
failing all cases of wasm EH + SjLj; only a few cases were failing and
our client was able to get around by fixing source code, but now we made
it fail for all cases, even the cases that previously succeeded fail,
which we didn't intend. This reverts that change.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D102364

Added: 
    

Modified: 
    llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
    llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
index 96a37ffb79ca2..0ec4b38c70f9a 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
@@ -677,8 +677,6 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runOnModule(Module &M) {
   if (EnableEH && TM.Options.ExceptionModel == ExceptionHandling::Wasm)
     report_fatal_error("-exception-model=wasm not allowed with "
                        "-enable-emscripten-cxx-exceptions");
-  if (DoSjLj && TM.Options.ExceptionModel == ExceptionHandling::Wasm)
-    report_fatal_error("Emscripten SjLj is not supported with Wasm EH yet");
 
   // Declare (or get) global variables __THREW__, __threwValue, and
   // getTempRet0/setTempRet0 function which are used in common for both

diff  --git a/llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll b/llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll
index fa30cd7d4a562..6ab5e3a4f77e7 100644
--- a/llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll
+++ b/llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll
@@ -4,7 +4,6 @@
 ; RUN: not --crash llc < %s -enable-emscripten-cxx-exceptions -mtriple=wasm64-unknown-unknown 2>&1 | FileCheck %s --check-prefix=WASM64-EH
 ; RUN: not --crash llc < %s -enable-emscripten-sjlj -mtriple=wasm64-unknown-unknown 2>&1 | FileCheck %s --check-prefix=WASM64-SJLJ
 ; RUN: not --crash llc < %s -enable-emscripten-cxx-exceptions -exception-model=wasm 2>&1 | FileCheck %s --check-prefix=WASM-EH-EM-EH
-; RUN: not --crash llc < %s -enable-emscripten-sjlj -exception-model=wasm 2>&1 | FileCheck %s --check-prefix=WASM-EH-EM-SJLJ
 
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"
@@ -107,4 +106,3 @@ attributes #2 = { nounwind }
 ; WASM64-EH: LLVM ERROR: Emscripten EH/SjLj is not supported with wasm64 yet
 ; WASM64-SJLJ: LLVM ERROR: Emscripten EH/SjLj is not supported with wasm64 yet
 ; WASM-EH-EM-EH: LLVM ERROR: -exception-model=wasm not allowed with -enable-emscripten-cxx-exceptions
-; WASM-EH-EM-SJLJ: LLVM ERROR: Emscripten SjLj is not supported with Wasm EH yet


        


More information about the llvm-commits mailing list