# stage2: eliminate ZIR arg instruction references to ZIR · gitcafe/zig

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

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

Visibility: public

Requested revision: 32edb9b55d0e41a58a11e0437149c4a9705c4699

Requested commit: 32edb9b55d0e41a58a11e0437149c4a9705c4699

Commit: 32edb9b55d0e41a58a11e0437149c4a9705c4699

Tree: c0497c52c28ae9f97a9fcb5c57fa89e33838f5bd

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: eliminate ZIR arg instruction references to ZIR

Prior to this commit, the AIR arg instruction kept a reference to a ZIR
string index for the corresponding parameter name. This is used by DWARF
emitting code. However, this is a design flaw because we want AIR
objects to be independent from ZIR.

This commit saves the parameter names into memory managed by
`Module.Fn`. This is sub-optimal because we should be able to get the
parameter names from the ZIR for a function without having them
redundantly stored along with `Fn` memory. However the current way that
ZIR param instructions are encoded does not support this case. They
appear in the same ZIR body as the function instruction, just before it.
Instead, they should be embedded within the function instruction, which
will allow this TODO to be solved. That improvement is too big for this
commit, however.

After this there is one last dependency to untangle, which is for inline
assembly. The issue for that is #10784.

```

## Parents

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

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