llvm-project/clang/lib/Driver
Heejin Ahn a947b40caf [WebAssembly] Add Wasm SjLj option support for clang
This adds support for Wasm SjLj in clang. Also this sets the new
`-mllvm -wasm-enable-eh` option for Wasm EH.

Note there is a little unfortunate inconsistency there: Wasm EH is
enabled by a clang option `-fwasm-exceptions`, which sets
`-mllvm -wasm-enable-eh` in the backend options. It also sets
`-exception-model=wasm` but this is done in the common code.

Wasm SjLj doesn't have a clang-level option like `-fwasm-exceptions`.
`-fwasm-exceptions` was added because each exception model has its
corresponding `-f***-exceptions`, but I'm not sure if adding a new
option like `-fwasm-sjlj` or something is a good idea.

So the current plan is Emscripten sets `-mllvm -wasm-enable-sjlj` if
Wasm SJLj is enabled in its settings.js, as it does for Emscripten
EH/SjLj (it sets `-mllvm -enable-emscripten-cxx-exceptions` for
Emscripten EH and `-mllvm -enable-emscripten-sjlj` for Emscripten SjLj).
And setting this enables the exception handling feature, and also sets
`-exception-model=wasm`, but this time this is not done in the common
code so we do it ourselves.

Also note that other exception models have 1-to-1 correspondance with
their `-f***-exceptions` flag and their `-exception-model=***` flag, but
because we use `-exception-model=wasm` also for Wasm SjLj while
`-fwasm-exceptions` still means Wasm EH, there is also a little
inconsistency there, but I think it is manageable.

Also this adds various error checking and tests.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D108582
2021-08-24 18:12:52 -07:00
..
ToolChains [WebAssembly] Add Wasm SjLj option support for clang 2021-08-24 18:12:52 -07:00
Action.cpp [CUDA][HIP] Add -fuse-cuid 2021-02-08 22:26:12 -05:00
CMakeLists.txt [clang] NFC, move DarwinSDKInfo to lib/Basic 2021-07-20 13:22:48 -07:00
Compilation.cpp [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
Distro.cpp Add support of the future Debian (Debian 12 - Bookworm) 2021-08-16 09:11:31 +02:00
Driver.cpp [CUDA] Bump default GPU architecture to sm_35. 2021-08-23 13:24:45 -07:00
DriverOptions.cpp
Job.cpp [clang][driver] NFC: Expose InputInfo in Job instead of plain filenames 2021-07-27 09:18:58 +02:00
Multilib.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
OptionUtils.cpp [NFC] Move OptionUtils from Basic to Driver 2019-12-23 08:11:23 -05:00
Phases.cpp [clang][ifs] Clang Interface Stubs ToolChain plumbing. 2019-10-08 15:23:14 +00:00
SanitizerArgs.cpp [asan][clang] Add flag to outline instrumentation 2021-07-14 13:36:34 -07:00
Tool.cpp [clang][driver] NFC: Move InputInfo.h from lib to include 2021-07-27 09:17:39 +02:00
ToolChain.cpp [clang][driver] NFC: Move InputInfo.h from lib to include 2021-07-27 09:17:39 +02:00
Types.cpp [Preprocessor] Implement -fminimize-whitespace. 2021-07-25 23:30:57 -05:00
XRayArgs.cpp [xray] Function coverage groups 2020-09-24 22:09:53 -04:00