[PATCH] D115893: [WebAssembly] Support clang -fwasm-exceptions for bitcode

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 16:14:27 PST 2021


aheejin added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp:37
 
-// Emscripten's asm.js-style exception handling
-cl::opt<bool>
-    WasmEnableEmEH("enable-emscripten-cxx-exceptions",
-                   cl::desc("WebAssembly Emscripten-style exception handling"),
-                   cl::init(false));
-
-// Emscripten's asm.js-style setjmp/longjmp handling
-cl::opt<bool> WasmEnableEmSjLj(
-    "enable-emscripten-sjlj",
-    cl::desc("WebAssembly Emscripten-style setjmp/longjmp handling"),
-    cl::init(false));
-
-// Exception handling using wasm EH instructions
-cl::opt<bool> WasmEnableEH("wasm-enable-eh",
-                           cl::desc("WebAssembly exception handling"),
-                           cl::init(false));
-
-// setjmp/longjmp handling using wasm EH instrutions
-cl::opt<bool> WasmEnableSjLj("wasm-enable-sjlj",
-                             cl::desc("WebAssembly setjmp/longjmp handling"),
-                             cl::init(false));
+extern cl::opt<bool> WasmEnableEmEH;   // asm.js-style EH
+extern cl::opt<bool> WasmEnableEmSjLj; // asm.js-style SjLJ
----------------
dschuff wrote:
> We could put these declarations in WebAssemblyUtilities.h; then they wouldn't have to be duplicated here and in WebAssemblyMCAsmInfo.cpp
Done. But as a result they are not within `WebAssembly` namespace, which I think is actually better because we have been cluttering the `llvm` namespace so far. And I needed to attach `WebAssembly::` to all the usages of these variables in other places. In this file I just used `using WebAssembly::***`, because there are too many usages of these options.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115893/new/

https://reviews.llvm.org/D115893



More information about the llvm-commits mailing list