# InternPool: remove runtime_value representation · gitcafe/zig

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

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

Visibility: public

Requested revision: 20bb81166f36668413703e0d74b3e283c55ab8ca

Requested commit: 20bb81166f36668413703e0d74b3e283c55ab8ca

Commit: 20bb81166f36668413703e0d74b3e283c55ab8ca

Tree: d68649f59e0899fbc49e7f9a188d3738f0ca1a3f

Author: mlugg

Committer: mlugg

## Message

```
InternPool: remove runtime_value representation

The main goal of this commit is to remove the `runtime_value` field from
`InternPool.Key` (and its associated representation), but there are a
few dominos. Specifically, this mostly eliminates the "maybe runtime"
concept from value resolution in Sema: so some resolution functions like
`resolveMaybeUndefValAllowVariablesMaybeRuntime` are gone. This required
a small change to struct/union/array initializers, to no longer
use `runtime_value` if a field was a `variable` - I'm not convinced this
case was even reachable, as `variable` should only ever exist as the
trivial value of a global runtime `var` decl.

Now, the only case in which a `Sema.resolveMaybeUndefVal`-esque function
can return the `variable` key is `resolveMaybeUndefValAllowVariables`,
which is directly called from `Sema.resolveInstValueAllowVariables`
(previously `Sema.resolveInstValue`), which is only used for resolving
the value of a Decl from `Module.semaDecl`.

While changing these functions, I also slightly reordered and
restructured some of them, and updated their doc comments.

```

## Parents

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

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