# astgen: clean up source line calculation and management · gitcafe/zig

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

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

Visibility: public

Requested revision: 627cf6ce482349c172150d058660f7a1646c2aac

Requested commit: 627cf6ce482349c172150d058660f7a1646c2aac

Commit: 627cf6ce482349c172150d058660f7a1646c2aac

Tree: f786071370621bca7f51e95e4a35c626083b3de8

Author: Jakub Konka

Committer: Andrew Kelley

## Message

```
astgen: clean up source line calculation and management

Clarify that `astgen.advanceSourceCursor` already increments absolute
values of the line and columns numbers; i.e., `GenZir.calcLine` is thus
not only obsolete but wrong by design.

Incidentally, this clean up allows for specifying the `FnDecl` line
numbers for DWARF use correctly as relative values with respect to
the start of the parent `Decl`. This `Decl` in turn has its line number
information specified relatively to its parent `Decl`, and so on, until
we reach the global scope.

```

## Parents

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

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