# stage2: make hasCodeGenBits\(\) always true for pointers · gitcafe/zig

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

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

Visibility: public

Requested revision: 186126c2a4032424e1b1cdb8ac379fb2beab7429

Requested commit: 186126c2a4032424e1b1cdb8ac379fb2beab7429

Commit: 186126c2a4032424e1b1cdb8ac379fb2beab7429

Tree: 32aa04aa0e19f7a9b4d51677c2051a3b7d7048c4

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: make hasCodeGenBits() always true for pointers

 * LLVM backend: The `alloc` AIR instruction as well as pointer
   constants which point to a 0-bit element type now call a common
   codepath to produce a `*const llvm.Value` which is a non-zero pointer
   with a bogus-but-properly-aligned address.
 * LLVM backend: improve the lowering of optional types.
 * Type: `hasCodeGenBits()` now returns `true` for pointers even when
   it returns `false` for their element types.

Effectively, #6706 is now implemented in stage2 but not stage1.

```

## Parents

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

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