diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-03-03 19:10:58 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-03 16:33:46 -0700 |
| commit | 43cb19ea4da63dcaa8a18a06e3ab23f1c822c1fe (patch) | |
| tree | cb5cb5fd83ddb948f5d3fddc7819849fb2154006 /src/arch/x86_64/CodeGen.zig | |
| parent | ec4c30ae483e6700a1fd1d5edaadbb042790c52e (diff) | |
| download | zig-43cb19ea4da63dcaa8a18a06e3ab23f1c822c1fe.tar.gz zig-43cb19ea4da63dcaa8a18a06e3ab23f1c822c1fe.zip | |
wasm: Implement `@wasmMemoryGrow` builtin
Similarly to the other wasm builtin, this implements the grow variation where the memory
index is a comptime known value. The operand as well as the result are runtime values.
This also verifies during semantic analysis the target we're building for is wasm, or else
emits a compilation error. This means that other backends do not have to handle this AIR instruction,
other than the wasm and LLVM backends.
Diffstat (limited to 'src/arch/x86_64/CodeGen.zig')
| -rw-r--r-- | src/arch/x86_64/CodeGen.zig | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index 33fd2c8321..fcffb6ddda 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -759,6 +759,9 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { .wrap_optional => try self.airWrapOptional(inst), .wrap_errunion_payload => try self.airWrapErrUnionPayload(inst), .wrap_errunion_err => try self.airWrapErrUnionErr(inst), + + .wasm_memory_size => unreachable, + .wasm_memory_grow => unreachable, // zig fmt: on } |
