# stage2: dbg_stmt ZIR instructions have line/col · gitcafe/zig

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

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

Visibility: public

Requested revision: eadcefc124b4ee61c99c8ed97434ed26e24c5f83

Requested commit: eadcefc124b4ee61c99c8ed97434ed26e24c5f83

Commit: eadcefc124b4ee61c99c8ed97434ed26e24c5f83

Tree: e76e08b8c4411a8ef609efdef020e9731e43de4b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: dbg_stmt ZIR instructions have line/col

instead of node indexes.

 * AstGen: dbg_stmt instructions now have line and column indexes,
   relative to the parent declaration. This allows codegen to emit debug
   info without having the source bytes, tokens, or AST nodes loaded
   in memory.
 * ZIR: each decl has the absolute line number. This allows computing
   line numbers from offsets without consulting source code bytes.

Memory management: creating a function definition does not prematurely
set the Decl arena. Instead the function is allocated with the general
purpose allocator.

Codegen no longer looks at source code bytes for any reason. They can
remain unloaded from disk.

```

## Parents

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

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