# self-hosted: improve handling of anonymous decls · gitcafe/zig

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

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

Visibility: public

Requested revision: d9c1d8fed3e121c4fe91d5aea301574ff763ef95

Requested commit: d9c1d8fed3e121c4fe91d5aea301574ff763ef95

Commit: d9c1d8fed3e121c4fe91d5aea301574ff763ef95

Tree: 4c59beda76ccadca05efe4be4064bba7527d208f

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
self-hosted: improve handling of anonymous decls

 * anonymous decls have automatically generated names and symbols, and
   participate in the same memory management as named decls.
 * the Ref instruction is deleted
 * the DeclRef instruction now takes a `[]const u8` and DeclRefStr takes
   an arbitrary string instruction operand.
 * introduce a `zir.Decl` type for ZIR Module decls which holds
   content_hash and name - fields that are not needed for `zir.Inst`
   which are created as part of semantic analysis. This improves the
   function signatures of Module.zig and lowers memory usage.
 * the Str instruction is now defined to create an anonymous Decl and
   reference it.

```

## Parents

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

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