D108960 added support for SjLj using Wasm EH instructions, which we call
Wasm SjLj going forward. (We call the old SjLj Emscripten SjLj) But it
did not support using Wasm EH and Wasm SjLj together. So far users of
Wasm EH had to use Wasm EH with Emscripten SjLj, which had a certain
limitation and it suffered from bigger code size increases as well.
This enables using Wasm EH and Wasm SjLj together.
- This redirects catchswitch and cleanupret that unwind to caller to catch.dispatch.longjmp BB, which is a catchswitch BB that handles longjmps.
- D108960 converted all longjmpable calls to invokes that unwind to catch.dispatch.longjmp. This CL checks if the call is embedded within another catchpad, and if so, makes it unwind to its nearest parent's unwind destination, rather than catch.dispatch.longjmp. This is necessary to preserve the scoping structure.
clang-format suggested style edits found: