diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-02-16 01:32:15 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-02-16 01:44:52 -0500 |
| commit | 7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991 (patch) | |
| tree | 1c726145e8b301beb25ab781ab9e06d27c146797 /src/analyze.cpp | |
| parent | cb3a818699649a985d5879151936b3b88ffddfa4 (diff) | |
| download | zig-7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991.tar.gz zig-7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991.zip | |
Implement noasync awaits
Note that there is not yet runtime safety for this.
See #3157
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index fc1a805d82..98366bc87d 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -4710,8 +4710,7 @@ static void analyze_fn_async(CodeGen *g, ZigFn *fn, bool resolve_frame) { } for (size_t i = 0; i < fn->await_list.length; i += 1) { IrInstGenAwait *await = fn->await_list.at(i); - // TODO If this is a noasync await, it doesn't count - // https://github.com/ziglang/zig/issues/3157 + if (await->is_noasync) continue; switch (analyze_callee_async(g, fn, await->target_fn, await->base.base.source_node, must_not_be_async, CallModifierNone)) { @@ -6315,8 +6314,9 @@ static Error resolve_async_frame(CodeGen *g, ZigType *frame_type) { // The funtion call result of foo() must be spilled. for (size_t i = 0; i < fn->await_list.length; i += 1) { IrInstGenAwait *await = fn->await_list.at(i); - // TODO If this is a noasync await, it doesn't suspend - // https://github.com/ziglang/zig/issues/3157 + if (await->is_noasync) { + continue; + } if (await->base.value->special != ConstValSpecialRuntime) { // Known at comptime. No spill, no suspend. continue; |
