<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54447>54447</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Make setjmp uninlinable
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:WebAssembly
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
aheejin
</td>
</tr>
</table>
<pre>
When EH is used with SjLj, Emscripten currently provides three ways of doing it:
1. Emscripten EH + Wasm EH
2. Wasm EH + Emscripten SjLj
3. Wasm EH + Wasm SjLj
[Emscripten EH/SjLj](https://emscripten.org/docs/porting/exceptions.html#javascript-based-exception-support) is an old way of emulating EH and SjLj using JavaScript from Emscripten. [Wasm EH/SjLj](https://emscripten.org/docs/porting/exceptions.html#webassembly-exception-handling-proposal) is a new faster way, which uses [Wasm exception handling instructions](https://github.com/WebAssembly/exception-handling).
The eventual recommended way of doing EH and SjLj together is 3. 2 was provided as an interim solution while Wasm SjLj was not implemented. But there are restrictions in 2 and 3. In 2, you cannot call `setjmp` in a function that uses EH (`catchpad` or `cleanuppad` instruction). In 3, you can have `setjmp` calls in the function that uses EH, but you cannot call it within the `catch` clause of `try`-`catch`.
Users can get around this restriction by modifying source code, but sometimes it is not easy because `setjmp` calls can be inlined. One way to fix this is to make `setjmp` calls uninlinable in Clang. (This issue is labeled with "backend:WebAssembly" because there's no separate WebAssembly label for Clang.)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVMuO2zgQ_Br50rAgU34edJhJMkgWu9hDspgzRbUsOhQp8GFHf79NauSRF4OcFvBDErurq7pLXZtmrF471PDlK0gHwWEDN-k7-H7585KxT_Cld8LKwVOICNai9mqEwZqrbNCB7ywi3PjowLTQGKnPIH1WPmXF56x42uTLfCqRsWd45a6n6ymC5fN9OltEJwIppnyMSdfvp2-_u-eHShl7SSG7zxk7dt4PLpJiL_TBe1xu7JkeNEY4-huM9cQ_Rv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