Emscripten's longjump and exception mechanism depends on two global variables,
__THREW__ and __threwValue, which are changed to be defined as thread-local
in https://github.com/emscripten-core/emscripten/pull/12056. This patch updates
the corresponding code in the WebAssembly backend to properly declare these
globals as thread-local as well.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Awesome thanks!
llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp | ||
---|---|---|
322 | I'm surprised this is the cleanest way to do make the global as TLS... I still find lambdas a little harder to parse that straight line code. It kind of makes me what to write a little named functions called makeTLSGlobal to make this easier tfor me to read, but maybe thats just me. |
Yes, because I moved the CoalesceFeaturesAndStripAtomics and LowerAtomics passes to run after this changed pass.
llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp | ||
---|---|---|
322 | Yeah, although I think the readability problem is mostly due to the huge number of arguments the GlobalVariable constructor takes. It would be nice if they had some more specific factory methods or constructor overloads. |
@kripken I'm going to land this. Will you take care of the combined roll with https://github.com/emscripten-core/emscripten/pull/12056?
I'm surprised this is the cleanest way to do make the global as TLS... I still find lambdas a little harder to parse that straight line code. It kind of makes me what to write a little named functions called makeTLSGlobal to make this easier tfor me to read, but maybe thats just me.