# stage2: rework runtime, comptime, inline function calls · gitcafe/zig

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

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

Visibility: public

Requested revision: 609b84611dcde382af5d9fbc2345ede468d31a6f

Requested commit: 609b84611dcde382af5d9fbc2345ede468d31a6f

Commit: 609b84611dcde382af5d9fbc2345ede468d31a6f

Tree: 9dab23600c4fd136b10ccd65eb3d908dfe6bb206

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: rework runtime, comptime, inline function calls

 * ZIR function instructions encode the index of the block that
   contains the function instruction. This allows Zig to later scan the
   block and find the parameter instructions, which is needed for
   semantically analyzing function bodies.

 * Runtime function calls insert AIR arg instructions and then inserts
   Sema inst_map entries mapping the ZIR param instructions to them.

 * comptime/inline function call inserts Sema inst_map entries mapping
   the ZIR param instructions to the AIR callsite arguments.

With this commit we are back to the tests passing.

```

## Parents

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

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