aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2024-05-28 16:27:04 -0700
committerGitHub <noreply@github.com>2024-05-28 16:27:04 -0700
commit722a5fce589cea76a0baf89ce731477bae8cf4b8 (patch)
tree0dbd16e158e215270498428535dd847886991646 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parent39e5036c0e22cea24df73d28746bb8fe0a117f9d (diff)
downloadllvm-722a5fce589cea76a0baf89ce731477bae8cf4b8.zip
llvm-722a5fce589cea76a0baf89ce731477bae8cf4b8.tar.gz
llvm-722a5fce589cea76a0baf89ce731477bae8cf4b8.tar.bz2
[WebAssembly] Add -wasm-enable-exnref option (#93597)
This adds `-wasm-enable-exnref`, which will enable the new EH instructions using `exnref` (adopted in Oct 2023 CG meeting): https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md This option should be used with `-wasm-enable-eh`.
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 6812699..fd92a35 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -385,6 +385,7 @@ FunctionPass *WebAssemblyPassConfig::createTargetRegisterAllocator(bool) {
using WebAssembly::WasmEnableEH;
using WebAssembly::WasmEnableEmEH;
using WebAssembly::WasmEnableEmSjLj;
+using WebAssembly::WasmEnableExnref;
using WebAssembly::WasmEnableSjLj;
static void basicCheckForEHAndSjLj(TargetMachine *TM) {
@@ -401,6 +402,9 @@ static void basicCheckForEHAndSjLj(TargetMachine *TM) {
if (WasmEnableEmEH && WasmEnableSjLj)
report_fatal_error(
"-enable-emscripten-cxx-exceptions not allowed with -wasm-enable-sjlj");
+ if (WasmEnableExnref && !WasmEnableEH)
+ report_fatal_error(
+ "-wasm-enable-exnref should be used with -wasm-enable-eh");
// Here we make sure TargetOptions.ExceptionModel is the same as
// MCAsmInfo.ExceptionsType. Normally these have to be the same, because clang