diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-07-17 15:10:56 +0200 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2022-07-25 06:34:00 +0200 |
| commit | 200b2e4ee108d388e0db2120aee38f83d1c7abdb (patch) | |
| tree | 49139a306103997d18ed83624b3fec2c3cb13468 /lib/std | |
| parent | bf28a47cf23a60539f7cc6cb87309d1a7fa01c18 (diff) | |
| download | zig-200b2e4ee108d388e0db2120aee38f83d1c7abdb.tar.gz zig-200b2e4ee108d388e0db2120aee38f83d1c7abdb.zip | |
llvm: correctly lower c-abi for Wasm target
When lowering the return type for Wasm if the calling convention is `C`,
it now correctly lower it according to what clang does as specified in:
https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md
This makes use of the same logic as the Wasm backend, ensuring the
generated code does not diverge in function signatures.
When passing arguments accross the C-ABI for the Wasm target,
we want slightly different behavior than x86_64.
For instance: a struct with multiple fields must always be passed
by reference, even if its ABI size fits in a single integer.
However, we do pass larger integers such as 128bit by value,
which LLVM will correctly lower to use double arguments instead.
Diffstat (limited to 'lib/std')
0 files changed, 0 insertions, 0 deletions
