# Sema: use a hash map for ZIR\-\>AIR mapping · gitcafe/zig

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

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

Visibility: public

Requested revision: 67f5a28257b50e72750f51a03d6ce9ee27ad1439

Requested commit: 67f5a28257b50e72750f51a03d6ce9ee27ad1439

Commit: 67f5a28257b50e72750f51a03d6ce9ee27ad1439

Tree: e2a205ff1e748ded4bfc848e0a841ac5cef3622a

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: use a hash map for ZIR->AIR mapping

Previously, ZIR was per-function so we could simply allocate a slice for
all ZIR instructions. However now ZIR is whole-file, so we need a sparse
mapping of ZIR to AIR instructions in order to not waste memory.

```

## Parents

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

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