# Eliminate switch_capture and switch_capture_ref ZIR tags · gitcafe/zig

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

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

Visibility: public

Requested revision: 00609e7edbbc949b12e29a8d9911d988b78d7e03

Requested commit: 00609e7edbbc949b12e29a8d9911d988b78d7e03

Commit: 00609e7edbbc949b12e29a8d9911d988b78d7e03

Tree: f5f76c6dc16054d3480398fd566e35099a74feb7

Author: mlugg

Committer: mlugg

## Message

```
Eliminate switch_capture and switch_capture_ref ZIR tags

These tags are unnecessary, as this information can be more efficiently
encoded within the switch_block instruction itself. We also use a neat
little trick to avoid needing a dummy instruction (like is used for
errdefer captures): since the switch_block itself cannot otherwise be
referenced within a prong, we can repurpose its index within prongs to
refer to the captured value.

```

## Parents

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

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