# AstGen: emit nosuspend function calls · gitcafe/zig

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

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

Visibility: public

Requested revision: fbfae832eaf520f7fcc632580b4b4a7fb171f90f

Requested commit: fbfae832eaf520f7fcc632580b4b4a7fb171f90f

Commit: fbfae832eaf520f7fcc632580b4b4a7fb171f90f

Tree: 1a8b34df8132e7bffc336235cfdae17f261f41c9

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
AstGen: emit nosuspend function calls

Inside a nosuspend block, emit function calls as nosuspend calls.
Also inside a comptime block, emit function calls as comptime calls.
Also emit `async foo()` calls as async calls.

Remove compile error for `nosuspend` block inside `suspend` block.
Instead of implicitly treating every `suspend` block also as a
`nosuspend` block (which would make sense), we leave suspension points
as compile errors, to hint to the programmer about accidents. Of course
they may then assert `nosuspend` by introducing a block within their
suspend block.

To make room in `Zir.Inst.Tag` I moved `typeof_peer` and `compile_log`
to `Extended`.

```

## Parents

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

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