# compiler: introduce new \`CallingConvention\` · gitcafe/zig

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

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

Visibility: public

Requested revision: 51706af908e0c6acb822ef36760b7fe31faf62a6

Requested commit: 51706af908e0c6acb822ef36760b7fe31faf62a6

Commit: 51706af908e0c6acb822ef36760b7fe31faf62a6

Tree: d814bcfcfd83ebc5fd50da11f18a9a6427a54859

Author: mlugg

Committer: mlugg

## Message

```
compiler: introduce new `CallingConvention`

This commit begins implementing accepted proposal #21209 by making
`std.builtin.CallingConvention` a tagged union.

The stage1 dance here is a little convoluted. This commit introduces the
new type as `NewCallingConvention`, keeping the old `CallingConvention`
around. The compiler uses `std.builtin.NewCallingConvention`
exclusively, but when fetching the type from `std` when running the
compiler (e.g. with `getBuiltinType`), the name `CallingConvention` is
used. This allows a prior build of Zig to be used to build this commit.
The next commit will update `zig1.wasm`, and then the compiler and
standard library can be updated to completely replace
`CallingConvention` with `NewCallingConvention`.

The second half of #21209 is to remove `@setAlignStack`, which will be
implemented in another commit after updating `zig1.wasm`.

```

## Parents

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

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