# stage2: LLVM backend: adjust replaceAllUsesWith usage · gitcafe/zig

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

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

Visibility: public

Requested revision: f293fbbeaf6c48e6ce1410743181f89f359eb697

Requested commit: f293fbbeaf6c48e6ce1410743181f89f359eb697

Commit: f293fbbeaf6c48e6ce1410743181f89f359eb697

Tree: a9df71d5e092872e8ba68a03337a03c3481f486b

Author: Andrew Kelley

Committer: Jakub Konka

## Message

```
stage2: LLVM backend: adjust replaceAllUsesWith usage

replaceAllUsesWith requires the type to be unchanged. So we bitcast
the new global to the old type and use that as the thing to replace
old uses.

Fixes an LLVM assertion found while troubleshooting #10837.

```

## Parents

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

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