diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-05-05 18:19:21 -0700 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2021-05-14 03:45:09 -0700 |
commit | 8e35a18e4ad416c48c8e48492676fb189ee2c720 (patch) | |
tree | 89255a3587b0c89dcbcefa7a49c11397b107161d /llvm/unittests/Support/MathExtrasTest.cpp | |
parent | ea0eec69f16e0f1b00fec413986e4e44f6f627fa (diff) | |
download | llvm-8e35a18e4ad416c48c8e48492676fb189ee2c720.zip llvm-8e35a18e4ad416c48c8e48492676fb189ee2c720.tar.gz llvm-8e35a18e4ad416c48c8e48492676fb189ee2c720.tar.bz2 |
[WebAssembly] Support Emscripten EH/SjLj in Wasm64
In wasm64, the signatures of some library functions and global variables
defined in Emscripten change:
- `emscripten_longjmp`: `(i32, i32) -> ()` -> `(i64, i32) -> ()`
This changes because the first argument is the address of a memory
buffer. This in turn causes more changes below.
- `setThrew`: `(i32, i32) -> ()` -> `(i64, i32) -> ()`
`emscripten_longjmp` calls `setThrew` with the i64 buffer argument as
the first parameter.
- `__THREW__` (global var): `i32` to `i64`
`setThrew`'s first argument is set to this `__THREW__` variable, so it
should change to i64 as well.
- `testSetjmp`: `(i32, i32*, i32) -> (i32)` -> `(i64, i32*, i32) -> (i32)`
In the code transformation done in this pass, the value of `__THREW__`
is passed as the first parameter of `testSetjmp`.
This patch creates some helper functions to easily get types that become
different depending on the wasm32/wasm64, and uses them to change
various function signatures and code transformations. Also updates the
tests with WASM32/WASM64 check lines.
(Untested) Emscripten side patch: https://github.com/emscripten-core/emscripten/pull/14108
Reviewed By: aardappel
Differential Revision: https://reviews.llvm.org/D101985
Diffstat (limited to 'llvm/unittests/Support/MathExtrasTest.cpp')
0 files changed, 0 insertions, 0 deletions