# InternPool: store alignment of anon decls · gitcafe/zig

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

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

Visibility: public

Requested revision: 7bab406c790566781406a7968be22961ed7c305d

Requested commit: 7bab406c790566781406a7968be22961ed7c305d

Commit: 7bab406c790566781406a7968be22961ed7c305d

Tree: e2f778d1c66dd62bf41da837bb76a882b792ec6e

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
InternPool: store alignment of anon decls

Commit 5393e56500d499753dbc39704c0161b47d1e4d5c has a flaw pointed out
by @mlugg: the `ty` field of pointer values changes when comptime values
are pointer-casted. This commit introduces a new encoding which
additionally stores the "original pointer type" which is used to store
the alignment of the anonymous decl, and potentially other information
in the future such as section and pointer address space. However, this
new encoding is only used when the original pointer type differs from
the casted pointer type in a meaningful way.

I was able to make the LLVM backend and the C backend lower anonymous
decls with the appropriate alignment, however I will need some help
figuring out how to do this for the backends that lower anonymous decls
via src/codegen.zig and the wasm backend.

```

## Parents

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

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