# stage2: add call_async ZIR instruction · gitcafe/zig

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

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

Visibility: public

Requested revision: 5a8c445779b3b87ba38fbcac0efcc7ebb3787161

Requested commit: 5a8c445779b3b87ba38fbcac0efcc7ebb3787161

Commit: 5a8c445779b3b87ba38fbcac0efcc7ebb3787161

Tree: f83e02739497a46928bb2c7baa36657f486d2294

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: add call_async ZIR instruction

This is to be used when the source code looks like this:

    var a = async b();

The instruction acts both as an alloc as well as a function call using
that alloc as the result location. This avoids multiple ZIR instructions
as well as complicated "inferred pointer" semantic analysis for a common
case.

AstGen is not yet updated to emit this new instruction.

```

## Parents

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

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