# stage2: ZIR encodes comptime parameters · gitcafe/zig

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

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

Visibility: public

Requested revision: dae4c18aa7999a866b6b145ed3c88cb6c06852be

Requested commit: dae4c18aa7999a866b6b145ed3c88cb6c06852be

Commit: dae4c18aa7999a866b6b145ed3c88cb6c06852be

Tree: 6aa41102b19c8e0af04bf1dd8af5158c4cc8b3a5

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: ZIR encodes comptime parameters

`func_extended` ZIR instructions now have a one of the unused flags used
as a `has_comptime_bits` boolean. When set, it means 1 or more
parameters are `comptime`. In this case, there is a u32 per every 32
parameters (usually just 1 u32) with each bit indicating whether the
corresponding parameter is `comptime`.

Sema uses this information to correctly mark generic functions as
generic. There is now a TODO compile error in place in case a generic
function call happens. A future commit will do the generic function call
implementation.

```

## Parents

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

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