# stage1: memoize strings in the AST · gitcafe/zig

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

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

Visibility: public

Requested revision: f5d4fe3e17533f83404c16fbceff0dc7bb12cb18

Requested commit: f5d4fe3e17533f83404c16fbceff0dc7bb12cb18

Commit: f5d4fe3e17533f83404c16fbceff0dc7bb12cb18

Tree: 2748965ae28b10f937bf0e45b2947861346503a2

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage1: memoize strings in the AST

Currently, stage1 runs astgen for every comptime function call,
resulting in identifier strings being allocated multiple times,
wasting memory. As a workaround until the code is adjusted to
make astgen run only once per source node, we memoize the
result into the AST.

 * Rename `ir_gen_*` to `astgen_*`
   - Oops, meant to do this in a separate commit. My bad.
 * tokenizer: avoid using designated initializer syntax.
   MSVC does not support it.

```

## Parents

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

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