# Zir: use absolute nodes for declarations and type declarations · gitcafe/zig

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

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

Visibility: public

Requested revision: e39cc0dff7fff510c3d72f61947b977589ea5583

Requested commit: e39cc0dff7fff510c3d72f61947b977589ea5583

Commit: e39cc0dff7fff510c3d72f61947b977589ea5583

Tree: 5d7c405520d5c898c46a517820bd331526b7852d

Author: mlugg

Committer: mlugg

## Message

```
Zir: use absolute nodes for declarations and type declarations

The justification for using relative source nodes in ZIR is that it
allows source locations -- which may be serialized across incremental
updates -- to be relative to the source location of their containing
declaration. However, having those "baseline" instructions themselves be
relative to their own parent is counterproductive, since the source
location updating problem is only being moved to `Decl`. Storing the
absolute node here instead makes more sense, since it allows for this
source location update logic to be elided entirely in the future by
storing a `TrackedInst.Index` to resolve a source location relative to
rather than a `Decl.Index`.

```

## Parents

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

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