[all-commits] [llvm/llvm-project] d1aca0: [WebAssembly] Define __WASM_EXCEPTIONS__ for -fwas...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Mon May 20 18:43:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1aca0ae2e0c52298966e35e4312e21045d4c6e4
      https://github.com/llvm/llvm-project/commit/d1aca0ae2e0c52298966e35e4312e21045d4c6e4
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2024-05-20 (Mon, 20 May 2024)

  Changed paths:
    M clang/lib/Frontend/InitPreprocessor.cpp
    M clang/test/CodeGenCXX/wasm-eh.cpp

  Log Message:
  -----------
  [WebAssembly] Define __WASM_EXCEPTIONS__ for -fwasm-exceptions (#92604)

When using other specific exception options in Clang, such as
`-fseh-exceptions` or `-fsjlj-exceptions`, Clang defines a corresponding
preprocessor such as `-D__USING_SJLJ_EXCEPTIONS__`. Emscripten does that
in our own build system:

https://github.com/emscripten-core/emscripten/blob/7dcd7f40749918e141dc33397d2f4311dd80637a/tools/system_libs.py#L1577-L1578

But to make Wasm EH usable in non-Emscripten toolchain, this has to be
defined somewhere else. This PR makes Wasm EH consistent with other
exception scheme by letting it defined by Clang depending on the
exception option.

We have been using `__USING_WASM_EXCEPTIONS__` in our current library
code, but this changes it to `__WASM_EXCEPTIONS__` for its conciseness,
and I will update other parts of LLVM as follow-ups. This does not break
anything currently working, because we have not been defining anything
in Clang so far.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list