[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 16:06:59 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:

I see. And come to think of it, as you said, I may not need to worry about the predefined macros in other users because they might be redundant but this will not break them because we define the macro in Clang.

Will update this to `__WASM_EXCEPTIONS__`, and update the macro in other parts of LLVM and Emscripten as follow-ups.

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


More information about the cfe-commits mailing list