diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-09-12 04:01:37 +0000 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2019-09-12 04:01:37 +0000 |
commit | e8b2b8868d2192fefe2ddf6445e465e283c3ba2d (patch) | |
tree | 7c1bc9eb5e57c79d5ce8559e8936e19759e962ca /clang/lib/CodeGen/BackendUtil.cpp | |
parent | bdfe84ad110fb386676955a24afd30f68b25b80b (diff) | |
download | bcm5719-llvm-e8b2b8868d2192fefe2ddf6445e465e283c3ba2d.tar.gz bcm5719-llvm-e8b2b8868d2192fefe2ddf6445e465e283c3ba2d.zip |
[WebAssembly] Add -fwasm-exceptions for wasm EH
Summary:
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.
Reviewers: dschuff, tlively, sbc100
Subscribers: aprantl, jgravelle-google, sunfish, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67208
llvm-svn: 371708
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 251b1fce6d8..71ae8fd4fb0 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -468,6 +468,8 @@ static void initTargetOptions(llvm::TargetOptions &Options, Options.ExceptionModel = llvm::ExceptionHandling::WinEH; if (LangOpts.DWARFExceptions) Options.ExceptionModel = llvm::ExceptionHandling::DwarfCFI; + if (LangOpts.WasmExceptions) + Options.ExceptionModel = llvm::ExceptionHandling::Wasm; Options.NoInfsFPMath = CodeGenOpts.NoInfsFPMath; Options.NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath; |