[PATCH] D67208: [WebAssembly] Add -fwasm-exceptions for wasm EH

Heejin Ahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 4 21:53:10 PDT 2019


aheejin created this revision.
aheejin added reviewers: dschuff, tlively.
Herald added subscribers: cfe-commits, sunfish, jgravelle-google, sbc100, aprantl.
Herald added a project: clang.

This adds `-fwasm-exceptions` (in similar fashion with
`-fdwarf-exceptions` or `-fsjlj-exceptions`) that turns on everything
with wasm exception handling from the frontend to the backend.

We currently have `-mexception-handling` in clang frontend, but this is
only about the architecture capability and does not turn on other
necessary options such as the exception model in the backend. (This can
be turned on with `llc -exception-model=wasm`, but llc is not invoked
separately as a command line tool, so this option has to be transferred
from clang.)

Turning on `-fwasm-exceptions` in clang also turns on
`-mexception-handling` if not specified, and will error out if
`-mno-exception-handling` is specified.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67208

Files:
  clang/include/clang/Basic/LangOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/CodeGen/CGException.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/WebAssembly.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGenCXX/wasm-eh.cpp
  clang/test/Driver/wasm-toolchain.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67208.218833.patch
Type: text/x-patch
Size: 8692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190905/b9359aa2/attachment.bin>


More information about the cfe-commits mailing list