diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-05-05 11:21:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-05 11:21:02 -0400 |
| commit | e6955688ac2255d3813e8d2994b6661bc651369b (patch) | |
| tree | 9879154a5e02b77e95c1cf04a7cde64cb7adc727 /src/analyze.cpp | |
| parent | fde6d28c237fbeae2ace8f2834190c6f9752712a (diff) | |
| parent | fdfdac493998a180eeffdcab66e579e7af250039 (diff) | |
| download | zig-e6955688ac2255d3813e8d2994b6661bc651369b.tar.gz zig-e6955688ac2255d3813e8d2994b6661bc651369b.zip | |
Merge pull request #5272 from tadeokondrak/noasync-to-nosuspend
Noasync to nosuspend
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index d170273808..4c3103c48c 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -106,7 +106,7 @@ static ScopeExpr *find_expr_scope(Scope *scope) { case ScopeIdDecls: case ScopeIdFnDef: case ScopeIdCompTime: - case ScopeIdNoAsync: + case ScopeIdNoSuspend: case ScopeIdVarDecl: case ScopeIdCImport: case ScopeIdSuspend: @@ -227,9 +227,9 @@ Scope *create_comptime_scope(CodeGen *g, AstNode *node, Scope *parent) { return &scope->base; } -Scope *create_noasync_scope(CodeGen *g, AstNode *node, Scope *parent) { - ScopeNoAsync *scope = heap::c_allocator.create<ScopeNoAsync>(); - init_scope(g, &scope->base, ScopeIdNoAsync, node, parent); +Scope *create_nosuspend_scope(CodeGen *g, AstNode *node, Scope *parent) { + ScopeNoSuspend *scope = heap::c_allocator.create<ScopeNoSuspend>(); + init_scope(g, &scope->base, ScopeIdNoSuspend, node, parent); return &scope->base; } @@ -3771,7 +3771,7 @@ void scan_decls(CodeGen *g, ScopeDecls *decls_scope, AstNode *node) { case NodeTypeCompTime: preview_comptime_decl(g, node, decls_scope); break; - case NodeTypeNoAsync: + case NodeTypeNoSuspend: case NodeTypeParamDecl: case NodeTypeReturnExpr: case NodeTypeDefer: @@ -4689,7 +4689,7 @@ void add_async_error_notes(CodeGen *g, ErrorMsg *msg, ZigFn *fn) { static Error analyze_callee_async(CodeGen *g, ZigFn *fn, ZigFn *callee, AstNode *call_node, bool must_not_be_async, CallModifier modifier) { - if (modifier == CallModifierNoAsync) + if (modifier == CallModifierNoSuspend) return ErrorNone; bool callee_is_async = false; switch (callee->type_entry->data.fn.fn_type_id.cc) { @@ -4812,7 +4812,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); - if (await->is_noasync) continue; + if (await->is_nosuspend) continue; switch (analyze_callee_async(g, fn, await->target_fn, await->base.base.source_node, must_not_be_async, CallModifierNone)) { @@ -6239,7 +6239,7 @@ static void mark_suspension_point(Scope *scope) { case ScopeIdDecls: case ScopeIdFnDef: case ScopeIdCompTime: - case ScopeIdNoAsync: + case ScopeIdNoSuspend: case ScopeIdCImport: case ScopeIdSuspend: case ScopeIdTypeOf: @@ -6472,7 +6472,7 @@ 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); - if (await->is_noasync) { + if (await->is_nosuspend) { continue; } if (await->base.value->special != ConstValSpecialRuntime) { |
