Rewrite setjmp/longjmp docs#562
Merged
alexcrichton merged 2 commits intoWebAssembly:mainfrom Sep 12, 2025
Merged
Conversation
* Provide flags for emitting the standard exception-handling instructions. * More further explain what flags are doing. * Show a sample program that can be compiled both ways. * Delegate running in a runtime to various runtimes, so remove the "run the program" documentation here. * Remove `wasm-opt` documentation since it's now documented how to emit the standard instructions directly with LLVM.
pchickey
approved these changes
Sep 11, 2025
SetjmpLongjmp.md
Outdated
| history and has a "legacy" version which shipped in browsers as well. This means | ||
| that there are two different, but similar, sets of instructions that can be | ||
| emitted to support `setjmp` and `longjmp`. LLVM is capable of emitting both at | ||
| this time. |
Collaborator
There was a problem hiding this comment.
Would be helpful if I could connect these two versions of instructions with the llvm name/setting for that here, e.g. "emitting both as of release XXX, using the legacy exception-handling instructions by default, or the standard exception-handling instructions when passed -mllvm -wasm-use-legacy-eh=false." I know you can connect these dots a few paragraphs down but it helps here too.
Collaborator
Author
There was a problem hiding this comment.
I'm sort of intentionally dancing around the question of the default and all the examples here explicitly specify -wasm-use-legacy-eh=true|false in that I'd ideally like to not cause more confusion by documenting a default that becomes obsolete soon (hopefully...)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wasm-optdocumentation since it's now documented how to emit the standard instructions directly with LLVM.