[WebAssembly] Error when wasm EH is used with Emscripten EH/SjLj
authorHeejin Ahn <aheejin@gmail.com>
Tue, 27 Apr 2021 21:59:12 +0000 (14:59 -0700)
committerHeejin Ahn <aheejin@gmail.com>
Tue, 27 Apr 2021 23:07:53 +0000 (16:07 -0700)
commitb4a5dd4da99a301608830769e9a0dbd76c075180
tree9f06640b54dbedf26a7bebbf3c491e93c4be6464
parenta921d2d2fb46b898794091e7410426c518a4f0cc
[WebAssembly] Error when wasm EH is used with Emscripten EH/SjLj

- Error out when both Emscripten EH and wasm EH are used together, i.e.,
  both `-enable-emscripten-cxx-exceptions` and `-exception-model=wasm`
  are given together. This will not happen if you use Emscripten, but
  this can happen when you call `llc` manually with wrong set of
  arguments.
- Currently we don't yet support using wasm EH with Emscripten SjLj.
  Unlike `-enable-emscripten-cxx-exceptions` which is turned on only
  when you use `emcc -s DISABLE_EXCEPTION_CATCHING=0`,
  `-enable-emscripten-sjlj` is turned on by Emscripten by default. So we
  error out only when it is turned on and `setjmp` or `longjmp` is
  actually used.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D101403
llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll