[clang] [WebAssembly] Define __USING_WASM_EXCEPTIONS__ for -fwasm-exceptions (PR #92604)

Heejin Ahn via cfe-commits cfe-commits at lists.llvm.org
Fri May 17 15:44:19 PDT 2024


================
@@ -1006,6 +1006,8 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
   else if (LangOpts.hasDWARFExceptions() &&
            (TI.getTriple().isThumb() || TI.getTriple().isARM()))
     Builder.defineMacro("__ARM_DWARF_EH__");
+  else if (LangOpts.hasWasmExceptions() && TI.getTriple().isWasm())
+    Builder.defineMacro("__USING_WASM_EXCEPTIONS__");
----------------
aheejin wrote:

Changing it in LLVM and Emscripten is not a big problem, but I'm still somewhat worried about non-Emscripten toolchain users who have `-D__USING_WASM_EXCEPTIONS__` somewhere in their build configuration. I can add some comment on the previous issues for Wasm EH library porting and change the parts of WASI toolchain that uses the macro.

And why do you think we should remove this define here in Clang (assuming we change this to whatever we like)? This is consistent with what other exception modes are doing, and people need this `define` somewhere.

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


More information about the cfe-commits mailing list