# stage2: cleanups to wasm memory intrinsics · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/e532b0c0b5d55d212d885c779ab9f2fa7443e56a)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: e532b0c0b5d55d212d885c779ab9f2fa7443e56a

Requested commit: e532b0c0b5d55d212d885c779ab9f2fa7443e56a

Commit: e532b0c0b5d55d212d885c779ab9f2fa7443e56a

Tree: 0a1e9b277c745518f2b64d8913fe5e065fe9cc1b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: cleanups to wasm memory intrinsics

 * AIR: use pl_op instead of ty_pl for wasm_memory_size. No need to
   store the type because the type is always `u32`.
 * AstGen: use coerced_ty for `@wasmMemorySize` and `@wasmMemoryGrow`
   and do the coercions in Sema.
 * Sema: use more accurate source locations for errors.
 * Provide more information in the compiler error message.
 * Codegen: use liveness data to avoid lowering unused
   `@wasmMemorySize`.
 * LLVM backend: add implementation
   - I wasn't able to test it because we are hitting a linker error for
     `-target wasm32-wasi -fLLVM`.
 * C backend: use `zig_unimplemented()` instead of silently doing wrong
   behavior for these builtins.
 * behavior tests: branch only on stage2_arch for inclusion of the
   wasm.zig file. We would change it to `builtin.cpu.arch` but that is
   causing a compiler crash on some backends.

```

## Parents

- [7fd32de0180c29dc4e3da72e9347f6f5ce167a38](https://git.cafe/gitcafe/zig/commit/7fd32de0180c29dc4e3da72e9347f6f5ce167a38?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/e532b0c0b5d55d212d885c779ab9f2fa7443e56a?format=markdown)
