# LLVM: C calling convention lowering fixes · gitcafe/zig

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

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

Visibility: public

Requested revision: 9c5fe5b5a435729f2bfc61a45dc6ebd0969faf89

Requested commit: 9c5fe5b5a435729f2bfc61a45dc6ebd0969faf89

Commit: 9c5fe5b5a435729f2bfc61a45dc6ebd0969faf89

Tree: 7cc5036a66a18b7e43388c9d1c99f581c908fd9b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
LLVM: C calling convention lowering fixes

For parameters and return types of functions with the C calling
convention, the LLVM backend now has a special lowering for the function
type that makes the function adhere to the C ABI. The AIR instruction
lowerings for call, ret, and ret_load are adjusted to bitcast the real
type to the ABI type if necessary.

More work on this will need to be done, however, this improvement is
enough that stage3 now passes all the same behavior tests that stage2
passes - notably, translate-c no longer has a segfault due to C ABI
issues with Zig's Clang C API wrapper.

```

## Parents

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

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