authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-03-23 00:19:29+01:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-03-23 00:23:41+01:00
log9f0b9b8da1a111d16eb8d1254212ff98a8b4be08
tree2d1b8a5c3355de2a2f116bd3d23ee69716c3c877
parent240b15381dd560cac004c5e84783fb93f03c0697
signature Commit is signed but in an unrecognized format.

stage2: remove all async related code

The current plan is to avoid using async and related features in the stage2 compiler so that we can bootstrap before implementing them. Having this untested and incomplete code in the codebase increases friction while working on stage2, in particular when preforming larger refactors such as the current zir memory layout rework. Therefore remove all async related code, leaving only error messages in astgen.

6 files changed, 19 insertions(+), 377 deletions(-)

src/Module.zig+2-89
......@@ -410,8 +410,6 @@ pub const Scope = struct {
410410 .gen_zir => return scope.cast(GenZir).?.zir_code.arena,
411411 .local_val => return scope.cast(LocalVal).?.gen_zir.zir_code.arena,
412412 .local_ptr => return scope.cast(LocalPtr).?.gen_zir.zir_code.arena,
413 .gen_suspend => return scope.cast(GenZir).?.zir_code.arena,
414 .gen_nosuspend => return scope.cast(Nosuspend).?.gen_zir.zir_code.arena,
415413 .file => unreachable,
416414 .container => unreachable,
417415 .decl_ref => unreachable,
......@@ -428,8 +426,6 @@ pub const Scope = struct {
428426 .gen_zir => scope.cast(GenZir).?.zir_code.decl,
429427 .local_val => scope.cast(LocalVal).?.gen_zir.zir_code.decl,
430428 .local_ptr => scope.cast(LocalPtr).?.gen_zir.zir_code.decl,
431 .gen_suspend => return scope.cast(GenZir).?.zir_code.decl,
432 .gen_nosuspend => return scope.cast(Nosuspend).?.gen_zir.zir_code.decl,
433429 .file => null,
434430 .container => null,
435431 .decl_ref => scope.cast(DeclRef).?.decl,
......@@ -442,8 +438,6 @@ pub const Scope = struct {
442438 .gen_zir => scope.cast(GenZir).?.zir_code.decl,
443439 .local_val => scope.cast(LocalVal).?.gen_zir.zir_code.decl,
444440 .local_ptr => scope.cast(LocalPtr).?.gen_zir.zir_code.decl,
445 .gen_suspend => return scope.cast(GenZir).?.zir_code.decl,
446 .gen_nosuspend => return scope.cast(Nosuspend).?.gen_zir.zir_code.decl,
447441 .file => null,
448442 .container => null,
449443 .decl_ref => scope.cast(DeclRef).?.decl,
......@@ -459,8 +453,6 @@ pub const Scope = struct {
459453 .local_ptr => return scope.cast(LocalPtr).?.gen_zir.zir_code.decl.container,
460454 .file => return &scope.cast(File).?.root_container,
461455 .container => return scope.cast(Container).?,
462 .gen_suspend => return scope.cast(GenZir).?.zir_code.decl.container,
463 .gen_nosuspend => return scope.cast(Nosuspend).?.gen_zir.zir_code.decl.container,
464456 .decl_ref => return scope.cast(DeclRef).?.decl.container,
465457 }
466458 }
......@@ -474,8 +466,6 @@ pub const Scope = struct {
474466 .gen_zir => unreachable,
475467 .local_val => unreachable,
476468 .local_ptr => unreachable,
477 .gen_suspend => unreachable,
478 .gen_nosuspend => unreachable,
479469 .file => unreachable,
480470 .container => return scope.cast(Container).?.fullyQualifiedNameHash(name),
481471 .decl_ref => unreachable,
......@@ -491,8 +481,6 @@ pub const Scope = struct {
491481 .local_val => return &scope.cast(LocalVal).?.gen_zir.zir_code.decl.container.file_scope.tree,
492482 .local_ptr => return &scope.cast(LocalPtr).?.gen_zir.zir_code.decl.container.file_scope.tree,
493483 .container => return &scope.cast(Container).?.file_scope.tree,
494 .gen_suspend => return &scope.cast(GenZir).?.zir_code.decl.container.file_scope.tree,
495 .gen_nosuspend => return &scope.cast(Nosuspend).?.gen_zir.zir_code.decl.container.file_scope.tree,
496484 .decl_ref => return &scope.cast(DeclRef).?.decl.container.file_scope.tree,
497485 }
498486 }
......@@ -501,10 +489,9 @@ pub const Scope = struct {
501489 pub fn getGenZir(scope: *Scope) *GenZir {
502490 return switch (scope.tag) {
503491 .block => unreachable,
504 .gen_zir, .gen_suspend => scope.cast(GenZir).?,
492 .gen_zir => scope.cast(GenZir).?,
505493 .local_val => return scope.cast(LocalVal).?.gen_zir,
506494 .local_ptr => return scope.cast(LocalPtr).?.gen_zir,
507 .gen_nosuspend => return scope.cast(Nosuspend).?.gen_zir,
508495 .file => unreachable,
509496 .container => unreachable,
510497 .decl_ref => unreachable,
......@@ -521,8 +508,6 @@ pub const Scope = struct {
521508 .gen_zir => unreachable,
522509 .local_val => unreachable,
523510 .local_ptr => unreachable,
524 .gen_suspend => unreachable,
525 .gen_nosuspend => unreachable,
526511 .decl_ref => unreachable,
527512 }
528513 }
......@@ -535,8 +520,6 @@ pub const Scope = struct {
535520 .local_val => unreachable,
536521 .local_ptr => unreachable,
537522 .block => unreachable,
538 .gen_suspend => unreachable,
539 .gen_nosuspend => unreachable,
540523 .decl_ref => unreachable,
541524 }
542525 }
......@@ -552,41 +535,11 @@ pub const Scope = struct {
552535 .local_val => @fieldParentPtr(LocalVal, "base", cur).parent,
553536 .local_ptr => @fieldParentPtr(LocalPtr, "base", cur).parent,
554537 .block => return @fieldParentPtr(Block, "base", cur).src_decl.container.file_scope,
555 .gen_suspend => @fieldParentPtr(GenZir, "base", cur).parent,
556 .gen_nosuspend => @fieldParentPtr(Nosuspend, "base", cur).parent,
557538 .decl_ref => return @fieldParentPtr(DeclRef, "base", cur).decl.container.file_scope,
558539 };
559540 }
560541 }
561542
562 pub fn getSuspend(base: *Scope) ?*Scope.GenZir {
563 var cur = base;
564 while (true) {
565 cur = switch (cur.tag) {
566 .gen_zir => @fieldParentPtr(GenZir, "base", cur).parent,
567 .local_val => @fieldParentPtr(LocalVal, "base", cur).parent,
568 .local_ptr => @fieldParentPtr(LocalPtr, "base", cur).parent,
569 .gen_nosuspend => @fieldParentPtr(Nosuspend, "base", cur).parent,
570 .gen_suspend => return @fieldParentPtr(GenZir, "base", cur),
571 else => return null,
572 };
573 }
574 }
575
576 pub fn getNosuspend(base: *Scope) ?*Scope.Nosuspend {
577 var cur = base;
578 while (true) {
579 cur = switch (cur.tag) {
580 .gen_zir => @fieldParentPtr(GenZir, "base", cur).parent,
581 .local_val => @fieldParentPtr(LocalVal, "base", cur).parent,
582 .local_ptr => @fieldParentPtr(LocalPtr, "base", cur).parent,
583 .gen_suspend => @fieldParentPtr(GenZir, "base", cur).parent,
584 .gen_nosuspend => return @fieldParentPtr(Nosuspend, "base", cur),
585 else => return null,
586 };
587 }
588 }
589
590543 fn name_hash_hash(x: NameHash) u32 {
591544 return @truncate(u32, @bitCast(u128, x));
592545 }
......@@ -604,8 +557,6 @@ pub const Scope = struct {
604557 gen_zir,
605558 local_val,
606559 local_ptr,
607 gen_suspend,
608 gen_nosuspend,
609560 /// Used for simple error reporting. Only contains a reference to a
610561 /// `Decl` for use with `srcDecl` and `ownerDecl`.
611562 /// Has no parents or children.
......@@ -1382,16 +1333,6 @@ pub const Scope = struct {
13821333 src: LazySrcLoc,
13831334 };
13841335
1385 pub const Nosuspend = struct {
1386 pub const base_tag: Tag = .gen_nosuspend;
1387
1388 base: Scope = Scope{ .tag = base_tag },
1389 /// Parents can be: `LocalVal`, `LocalPtr`, `GenZir`.
1390 parent: *Scope,
1391 gen_zir: *GenZir,
1392 src: LazySrcLoc,
1393 };
1394
13951336 pub const DeclRef = struct {
13961337 pub const base_tag: Tag = .decl_ref;
13971338 base: Scope = Scope{ .tag = base_tag },
......@@ -1475,8 +1416,6 @@ pub const WipZirCode = struct {
14751416 .bool_and,
14761417 .bool_or,
14771418 .call,
1478 .call_async_kw,
1479 .call_no_async,
14801419 .call_compile_time,
14811420 .call_none,
14821421 .cmp_lt,
......@@ -1549,7 +1488,6 @@ pub const WipZirCode = struct {
15491488 .enum_literal,
15501489 .enum_literal_small,
15511490 .merge_error_sets,
1552 .anyframe_type,
15531491 .error_union_type,
15541492 .bit_not,
15551493 .error_set,
......@@ -1560,9 +1498,6 @@ pub const WipZirCode = struct {
15601498 .import,
15611499 .typeof_peer,
15621500 .resolve_inferred_alloc,
1563 .@"resume",
1564 .@"await",
1565 .nosuspend_await,
15661501 => return false,
15671502
15681503 .breakpoint,
......@@ -1581,8 +1516,6 @@ pub const WipZirCode = struct {
15811516 .ret_coerce,
15821517 .@"unreachable",
15831518 .loop,
1584 .suspend_block,
1585 .suspend_block_one,
15861519 .elided,
15871520 => return true,
15881521 }
......@@ -1692,7 +1625,6 @@ pub const SrcLoc = struct {
16921625 .node_offset_asm_source,
16931626 .node_offset_asm_ret_ty,
16941627 .node_offset_if_cond,
1695 .node_offset_anyframe_type,
16961628 .node_offset_bin_op,
16971629 .node_offset_bin_lhs,
16981630 .node_offset_bin_rhs,
......@@ -1750,7 +1682,6 @@ pub const SrcLoc = struct {
17501682 .node_offset_asm_source => @panic("TODO"),
17511683 .node_offset_asm_ret_ty => @panic("TODO"),
17521684 .node_offset_if_cond => @panic("TODO"),
1753 .node_offset_anyframe_type => @panic("TODO"),
17541685 .node_offset_bin_op => @panic("TODO"),
17551686 .node_offset_bin_lhs => @panic("TODO"),
17561687 .node_offset_bin_rhs => @panic("TODO"),
......@@ -1872,12 +1803,6 @@ pub const LazySrcLoc = union(enum) {
18721803 /// to the condition expression.
18731804 /// The Decl is determined contextually.
18741805 node_offset_if_cond: i32,
1875 /// The source location points to the type expression of an `anyframe->T`
1876 /// expression, found by taking this AST node index offset from the containing
1877 /// Decl AST node, which points to a `anyframe->T` expression AST node. Next, navigate
1878 /// to the type expression.
1879 /// The Decl is determined contextually.
1880 node_offset_anyframe_type: i32,
18811806 /// The source location points to a binary expression, such as `a + b`, found
18821807 /// by taking this AST node index offset from the containing Decl AST node.
18831808 /// The Decl is determined contextually.
......@@ -1922,7 +1847,6 @@ pub const LazySrcLoc = union(enum) {
19221847 .node_offset_asm_source,
19231848 .node_offset_asm_ret_ty,
19241849 .node_offset_if_cond,
1925 .node_offset_anyframe_type,
19261850 .node_offset_bin_op,
19271851 .node_offset_bin_lhs,
19281852 .node_offset_bin_rhs,
......@@ -1962,7 +1886,6 @@ pub const LazySrcLoc = union(enum) {
19621886 .node_offset_asm_source,
19631887 .node_offset_asm_ret_ty,
19641888 .node_offset_if_cond,
1965 .node_offset_anyframe_type,
19661889 .node_offset_bin_op,
19671890 .node_offset_bin_lhs,
19681891 .node_offset_bin_rhs,
......@@ -3888,7 +3811,7 @@ pub fn failWithOwnedErrorMsg(mod: *Module, scope: *Scope, err_msg: *ErrorMsg) In
38883811 }
38893812 mod.failed_decls.putAssumeCapacityNoClobber(block.sema.owner_decl, err_msg);
38903813 },
3891 .gen_zir, .gen_suspend => {
3814 .gen_zir => {
38923815 const gen_zir = scope.cast(Scope.GenZir).?;
38933816 gen_zir.zir_code.decl.analysis = .sema_failure;
38943817 gen_zir.zir_code.decl.generation = mod.generation;
......@@ -3906,12 +3829,6 @@ pub fn failWithOwnedErrorMsg(mod: *Module, scope: *Scope, err_msg: *ErrorMsg) In
39063829 gen_zir.zir_code.decl.generation = mod.generation;
39073830 mod.failed_decls.putAssumeCapacityNoClobber(gen_zir.zir_code.decl, err_msg);
39083831 },
3909 .gen_nosuspend => {
3910 const gen_zir = scope.cast(Scope.Nosuspend).?.gen_zir;
3911 gen_zir.zir_code.decl.analysis = .sema_failure;
3912 gen_zir.zir_code.decl.generation = mod.generation;
3913 mod.failed_decls.putAssumeCapacityNoClobber(gen_zir.zir_code.decl, err_msg);
3914 },
39153832 .file => unreachable,
39163833 .container => unreachable,
39173834 .decl_ref => {
......@@ -4157,10 +4074,6 @@ pub fn errorUnionType(
41574074 });
41584075}
41594076
4160pub fn anyframeType(mod: *Module, arena: *Allocator, return_type: Type) Allocator.Error!Type {
4161 return Type.Tag.anyframe_T.create(arena, return_type);
4162}
4163
41644077pub fn dumpInst(mod: *Module, scope: *Scope, inst: *ir.Inst) void {
41654078 const zir_module = scope.namespace();
41664079 const source = zir_module.getSource(mod) catch @panic("dumpInst failed to get source");
src/Sema.zig-31
......@@ -97,8 +97,6 @@ pub fn analyzeBody(sema: *Sema, block: *Scope.Block, body: []const zir.Inst.Inde
9797 .break_void_tok => try sema.zirBreakVoidTok(block, zir_inst),
9898 .breakpoint => try sema.zirBreakpoint(block, zir_inst),
9999 .call => try sema.zirCall(block, zir_inst, .auto),
100 .call_async_kw => try sema.zirCall(block, zir_inst, .async_kw),
101 .call_no_async => try sema.zirCall(block, zir_inst, .no_async),
102100 .call_compile_time => try sema.zirCall(block, zir_inst, .compile_time),
103101 .call_none => try sema.zirCallNone(block, zir_inst),
104102 .coerce_result_ptr => try sema.zirCoerceResultPtr(block, zir_inst),
......@@ -205,7 +203,6 @@ pub fn analyzeBody(sema: *Sema, block: *Scope.Block, body: []const zir.Inst.Inde
205203 .enum_literal_small => try sema.zirEnumLiteralSmall(block, zir_inst),
206204 .merge_error_sets => try sema.zirMergeErrorSets(block, zir_inst),
207205 .error_union_type => try sema.zirErrorUnionType(block, zir_inst),
208 .anyframe_type => try sema.zirAnyframeType(block, zir_inst),
209206 .error_set => try sema.zirErrorSet(block, zir_inst),
210207 .error_value => try sema.zirErrorValue(block, zir_inst),
211208 .slice_start => try sema.zirSliceStart(block, zir_inst),
......@@ -214,11 +211,6 @@ pub fn analyzeBody(sema: *Sema, block: *Scope.Block, body: []const zir.Inst.Inde
214211 .import => try sema.zirImport(block, zir_inst),
215212 .bool_and => try sema.zirBoolOp(block, zir_inst, false),
216213 .bool_or => try sema.zirBoolOp(block, zir_inst, true),
217 .@"await" => try sema.zirAwait(block, zir_inst),
218 .nosuspend_await => try sema.zirNosuspendAwait(block, zir_inst),
219 .suspend_block_one => @panic("TODO"),
220 .suspend_block => @panic("TODO"),
221 .@"resume" => @panic("TODO"),
222214 // TODO
223215 //.switchbr => try sema.zirSwitchBr(block, zir_inst, false),
224216 //.switchbr_ref => try sema.zirSwitchBr(block, zir_inst, true),
......@@ -1276,19 +1268,6 @@ fn zirErrorUnionType(sema: *Sema, block: *Scope.Block, inst: zir.Inst.Index) Inn
12761268 return sema.mod.constType(sema.arena, .unneeded, err_union_ty);
12771269}
12781270
1279fn zirAnyframeType(sema: *Sema, block: *Scope.Block, inst: zir.Inst.Index) InnerError!*Inst {
1280 const tracy = trace(@src());
1281 defer tracy.end();
1282
1283 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
1284 const src = inst_data.src();
1285 const operand_src: LazySrcLoc = .{ .node_offset_anyframe_type = inst_data.src_node };
1286 const return_type = try sema.resolveType(block, operand_src, inst_data.operand);
1287 const anyframe_type = try sema.mod.anyframeType(sema.arena, return_type);
1288
1289 return sema.mod.constType(sema.arena, src, anyframe_type);
1290}
1291
12921271fn zirErrorSet(sema: *Sema, block: *Scope.Block, inst: zir.Inst.Index) InnerError!*Inst {
12931272 const tracy = trace(@src());
12941273 defer tracy.end();
......@@ -2989,16 +2968,6 @@ fn zirPtrType(sema: *Sema, block: *Scope.Block, inst: zir.Inst.Index) InnerError
29892968 return sema.mod.constType(sema.arena, src, ty);
29902969}
29912970
2992fn zirAwait(sema: *Sema, block: *Scope.Block, inst: zir.Inst.Index) InnerError!*Inst {
2993 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
2994 return sema.mod.fail(&block.base, inst_data.src(), "TODO implement Sema await", .{});
2995}
2996
2997fn zirNosuspendAwait(sema: *Sema, block: *Scope.Block, inst: zir.Inst.Index) InnerError!*Inst {
2998 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
2999 return sema.mod.fail(&block.base, inst_data.src(), "TODO implement Sema nosuspend_await", .{});
3000}
3001
30022971fn requireFunctionBlock(sema: *Sema, block: *Scope.Block, src: LazySrcLoc) !void {
30032972 if (sema.func == null) {
30042973 return sema.mod.fail(&block.base, src, "instruction illegal outside function body", .{});
src/astgen.zig+16-133
......@@ -527,21 +527,8 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) In
527527 const result = try addZIRBinOp(mod, scope, src, .merge_error_sets, lhs, rhs);
528528 return rvalue(mod, scope, rl, result);
529529 },
530 .anyframe_literal => {
531 if (true) @panic("TODO update for zir-memory-layout");
532 const main_token = main_tokens[node];
533 const result = try addZIRInstConst(mod, scope, src, .{
534 .ty = Type.initTag(.type),
535 .val = Value.initTag(.anyframe_type),
536 });
537 return rvalue(mod, scope, rl, result);
538 },
539 .anyframe_type => {
540 if (true) @panic("TODO update for zir-memory-layout");
541 const return_type = try typeExpr(mod, scope, node_datas[node].rhs);
542 const result = try addZIRUnOp(mod, scope, src, .anyframe_type, return_type);
543 return rvalue(mod, scope, rl, result);
544 },
530 .anyframe_literal => return mod.failNode(scope, node, "async and related features are not yet supported", .{}),
531 .anyframe_type => return mod.failNode(scope, node, "async and related features are not yet supported", .{}),
545532 .@"catch" => {
546533 if (true) @panic("TODO update for zir-memory-layout");
547534 const catch_token = main_tokens[node];
......@@ -641,12 +628,10 @@ pub fn expr(mod: *Module, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) In
641628 .@"comptime" => return comptimeExpr(mod, scope, rl, node_datas[node].lhs),
642629 .@"switch", .switch_comma => return switchExpr(mod, scope, rl, node),
643630
644 .@"nosuspend" => return nosuspendExpr(mod, scope, rl, node),
645 .@"suspend" => @panic("TODO"),
646 //.@"suspend" => return rvalue(mod, scope, rl, try suspendExpr(mod, scope, node)),
647 .@"await" => return awaitExpr(mod, scope, rl, node),
648 .@"resume" => @panic("TODO"),
649 //.@"resume" => return rvalue(mod, scope, rl, try resumeExpr(mod, scope, node)),
631 .@"nosuspend" => return mod.failNode(scope, node, "async and related features are not yet supported", .{}),
632 .@"suspend" => return mod.failNode(scope, node, "async and related features are not yet supported", .{}),
633 .@"await" => return mod.failNode(scope, node, "async and related features are not yet supported", .{}),
634 .@"resume" => return mod.failNode(scope, node, "async and related features are not yet supported", .{}),
650635
651636 .@"defer" => return mod.failNode(scope, node, "TODO implement astgen.expr for .defer", .{}),
652637 .@"errdefer" => return mod.failNode(scope, node, "TODO implement astgen.expr for .errdefer", .{}),
......@@ -782,8 +767,6 @@ fn breakExpr(
782767 },
783768 .local_val => scope = scope.cast(Scope.LocalVal).?.parent,
784769 .local_ptr => scope = scope.cast(Scope.LocalPtr).?.parent,
785 .gen_suspend => scope = scope.cast(Scope.GenZir).?.parent,
786 .gen_nosuspend => scope = scope.cast(Scope.Nosuspend).?.parent,
787770 else => if (break_label != 0) {
788771 const label_name = try mod.identifierTokenString(parent_scope, break_label);
789772 return mod.failTok(parent_scope, break_label, "label not found: '{s}'", .{label_name});
......@@ -836,8 +819,6 @@ fn continueExpr(
836819 },
837820 .local_val => scope = scope.cast(Scope.LocalVal).?.parent,
838821 .local_ptr => scope = scope.cast(Scope.LocalPtr).?.parent,
839 .gen_suspend => scope = scope.cast(Scope.GenZir).?.parent,
840 .gen_nosuspend => scope = scope.cast(Scope.Nosuspend).?.parent,
841822 else => if (break_label != 0) {
842823 const label_name = try mod.identifierTokenString(parent_scope, break_label);
843824 return mod.failTok(parent_scope, break_label, "label not found: '{s}'", .{label_name});
......@@ -910,8 +891,6 @@ fn checkLabelRedefinition(mod: *Module, parent_scope: *Scope, label: ast.TokenIn
910891 },
911892 .local_val => scope = scope.cast(Scope.LocalVal).?.parent,
912893 .local_ptr => scope = scope.cast(Scope.LocalPtr).?.parent,
913 .gen_suspend => scope = scope.cast(Scope.GenZir).?.parent,
914 .gen_nosuspend => scope = scope.cast(Scope.Nosuspend).?.parent,
915894 else => return,
916895 }
917896 }
......@@ -1111,8 +1090,6 @@ fn varDecl(
11111090 s = local_ptr.parent;
11121091 },
11131092 .gen_zir => s = s.cast(Scope.GenZir).?.parent,
1114 .gen_suspend => s = s.cast(Scope.GenZir).?.parent,
1115 .gen_nosuspend => s = s.cast(Scope.Nosuspend).?.parent,
11161093 else => break,
11171094 };
11181095 }
......@@ -2797,8 +2774,6 @@ fn identifier(
27972774 s = local_ptr.parent;
27982775 },
27992776 .gen_zir => s = s.cast(Scope.GenZir).?.parent,
2800 .gen_suspend => s = s.cast(Scope.GenZir).?.parent,
2801 .gen_nosuspend => s = s.cast(Scope.Nosuspend).?.parent,
28022777 else => break,
28032778 };
28042779 }
......@@ -3272,7 +3247,6 @@ fn builtinCall(
32723247 .add_with_overflow,
32733248 .align_cast,
32743249 .align_of,
3275 .async_call,
32763250 .atomic_load,
32773251 .atomic_rmw,
32783252 .atomic_store,
......@@ -3305,10 +3279,6 @@ fn builtinCall(
33053279 .fence,
33063280 .field_parent_ptr,
33073281 .float_to_int,
3308 .frame,
3309 .Frame,
3310 .frame_address,
3311 .frame_size,
33123282 .has_decl,
33133283 .has_field,
33143284 .int_to_enum,
......@@ -3362,6 +3332,13 @@ fn builtinCall(
33623332 => return mod.failTok(scope, builtin_token, "TODO: implement builtin function {s}", .{
33633333 builtin_name,
33643334 }),
3335
3336 .async_call,
3337 .frame,
3338 .Frame,
3339 .frame_address,
3340 .frame_size,
3341 => return mod.failTok(scope, builtin_token, "async and related features are not yet supported", .{}),
33653342 }
33663343}
33673344
......@@ -3373,7 +3350,7 @@ fn callExpr(
33733350 call: ast.full.Call,
33743351) InnerError!zir.Inst.Ref {
33753352 if (call.async_token) |async_token| {
3376 return mod.failTok(scope, async_token, "TODO implement async fn call", .{});
3353 return mod.failTok(scope, async_token, "async and related features are not yet supported", .{});
33773354 }
33783355 const lhs = try expr(mod, scope, .none, call.ast.fn_expr);
33793356
......@@ -3402,10 +3379,10 @@ fn callExpr(
34023379 true => break :res try gz.addUnNode(.call_none, lhs, node),
34033380 false => .call,
34043381 },
3405 .async_kw => .call_async_kw,
3382 .async_kw => return mod.failNode(scope, node, "async and related features are not yet supported", .{}),
34063383 .never_tail => unreachable,
34073384 .never_inline => unreachable,
3408 .no_async => .call_no_async,
3385 .no_async => return mod.failNode(scope, node, "async and related features are not yet supported", .{}),
34093386 .always_tail => unreachable,
34103387 .always_inline => unreachable,
34113388 .compile_time => .call_compile_time,
......@@ -3415,99 +3392,6 @@ fn callExpr(
34153392 return rvalue(mod, scope, rl, result, node); // TODO function call with result location
34163393}
34173394
3418fn suspendExpr(mod: *Module, scope: *Scope, node: ast.Node.Index) InnerError!zir.Inst.Ref {
3419 const tree = scope.tree();
3420 const src = tree.tokens.items(.start)[tree.nodes.items(.main_token)[node]];
3421
3422 if (scope.getNosuspend()) |some| {
3423 const msg = msg: {
3424 const msg = try mod.errMsg(scope, src, "suspend in nosuspend block", .{});
3425 errdefer msg.destroy(mod.gpa);
3426 try mod.errNote(scope, some.src, msg, "nosuspend block here", .{});
3427 break :msg msg;
3428 };
3429 return mod.failWithOwnedErrorMsg(scope, msg);
3430 }
3431
3432 if (scope.getSuspend()) |some| {
3433 const msg = msg: {
3434 const msg = try mod.errMsg(scope, src, "cannot suspend inside suspend block", .{});
3435 errdefer msg.destroy(mod.gpa);
3436 try mod.errNote(scope, some.src, msg, "other suspend block here", .{});
3437 break :msg msg;
3438 };
3439 return mod.failWithOwnedErrorMsg(scope, msg);
3440 }
3441
3442 var suspend_scope: Scope.GenZir = .{
3443 .base = .{ .tag = .gen_suspend },
3444 .parent = scope,
3445 .decl = scope.ownerDecl().?,
3446 .arena = scope.arena(),
3447 .force_comptime = scope.isComptime(),
3448 .instructions = .{},
3449 };
3450 defer suspend_scope.instructions.deinit(mod.gpa);
3451
3452 const operand = tree.nodes.items(.data)[node].lhs;
3453 if (operand != 0) {
3454 const possibly_unused_result = try expr(mod, &suspend_scope.base, .none, operand);
3455 if (!possibly_unused_result.tag.isNoReturn()) {
3456 _ = try addZIRUnOp(mod, &suspend_scope.base, src, .ensure_result_used, possibly_unused_result);
3457 }
3458 } else {
3459 return addZIRNoOp(mod, scope, src, .@"suspend");
3460 }
3461
3462 const block = try addZIRInstBlock(mod, scope, src, .suspend_block, .{
3463 .instructions = try scope.arena().dupe(zir.Inst.Ref, suspend_scope.instructions.items),
3464 });
3465 return &block.base;
3466}
3467
3468fn nosuspendExpr(mod: *Module, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerError!zir.Inst.Ref {
3469 if (true) @panic("TODO update for zir-memory-layout");
3470 const tree = scope.tree();
3471 var child_scope = Scope.Nosuspend{
3472 .parent = scope,
3473 .gen_zir = scope.getGenZir(),
3474 .src = tree.tokens.items(.start)[tree.nodes.items(.main_token)[node]],
3475 };
3476
3477 return expr(mod, &child_scope.base, rl, tree.nodes.items(.data)[node].lhs);
3478}
3479
3480fn awaitExpr(mod: *Module, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerError!zir.Inst.Ref {
3481 if (true) @panic("TODO update for zir-memory-layout");
3482 const tree = scope.tree();
3483 const src = tree.tokens.items(.start)[tree.nodes.items(.main_token)[node]];
3484 const is_nosuspend = scope.getNosuspend() != null;
3485
3486 // TODO some @asyncCall stuff
3487
3488 if (scope.getSuspend()) |some| {
3489 const msg = msg: {
3490 const msg = try mod.errMsg(scope, src, "cannot await inside suspend block", .{});
3491 errdefer msg.destroy(mod.gpa);
3492 try mod.errNote(scope, some.src, msg, "suspend block here", .{});
3493 break :msg msg;
3494 };
3495 return mod.failWithOwnedErrorMsg(scope, msg);
3496 }
3497
3498 const operand = try expr(mod, scope, .ref, tree.nodes.items(.data)[node].lhs);
3499 // TODO pass result location
3500 return addZIRUnOp(mod, scope, src, if (is_nosuspend) .nosuspend_await else .@"await", operand);
3501}
3502
3503fn resumeExpr(mod: *Module, scope: *Scope, node: ast.Node.Index) InnerError!zir.Inst.Ref {
3504 const tree = scope.tree();
3505 const src = tree.tokens.items(.start)[tree.nodes.items(.main_token)[node]];
3506
3507 const operand = try expr(mod, scope, .ref, tree.nodes.items(.data)[node].lhs);
3508 return addZIRUnOp(mod, scope, src, .@"resume", operand);
3509}
3510
35113395pub const simple_types = std.ComptimeStringMap(zir.Const, .{
35123396 .{ "u8", .u8_type },
35133397 .{ "i8", .i8_type },
......@@ -3542,7 +3426,6 @@ pub const simple_types = std.ComptimeStringMap(zir.Const, .{
35423426 .{ "noreturn", .noreturn_type },
35433427 .{ "null", .null_type },
35443428 .{ "undefined", .undefined_type },
3545 .{ "anyframe", .anyframe_type },
35463429 .{ "undefined", .undef },
35473430 .{ "null", .null_value },
35483431 .{ "true", .bool_true },
src/type.zig+1-66
......@@ -92,8 +92,6 @@ pub const Type = extern union {
9292
9393 .anyerror_void_error_union, .error_union => return .ErrorUnion,
9494
95 .anyframe_T, .@"anyframe" => return .AnyFrame,
96
9795 .empty_struct => return .Struct,
9896
9997 .var_args_param => unreachable, // can be any type
......@@ -397,7 +395,6 @@ pub const Type = extern union {
397395 .const_slice_u8,
398396 .enum_literal,
399397 .anyerror_void_error_union,
400 .@"anyframe",
401398 .inferred_alloc_const,
402399 .inferred_alloc_mut,
403400 .var_args_param,
......@@ -418,7 +415,6 @@ pub const Type = extern union {
418415 .optional,
419416 .optional_single_mut_pointer,
420417 .optional_single_const_pointer,
421 .anyframe_T,
422418 => return self.copyPayloadShallow(allocator, Payload.ElemType),
423419
424420 .int_signed,
......@@ -546,7 +542,6 @@ pub const Type = extern union {
546542
547543 // TODO this should print the structs name
548544 .empty_struct => return out_stream.writeAll("struct {}"),
549 .@"anyframe" => return out_stream.writeAll("anyframe"),
550545 .anyerror_void_error_union => return out_stream.writeAll("anyerror!void"),
551546 .const_slice_u8 => return out_stream.writeAll("[]const u8"),
552547 .fn_noreturn_no_args => return out_stream.writeAll("fn() noreturn"),
......@@ -574,12 +569,6 @@ pub const Type = extern union {
574569 continue;
575570 },
576571
577 .anyframe_T => {
578 const return_type = ty.castTag(.anyframe_T).?.data;
579 try out_stream.print("anyframe->", .{});
580 ty = return_type;
581 continue;
582 },
583572 .array_u8 => {
584573 const len = ty.castTag(.array_u8).?.data;
585574 return out_stream.print("[{d}]u8", .{len});
......@@ -814,8 +803,6 @@ pub const Type = extern union {
814803 .optional,
815804 .optional_single_mut_pointer,
816805 .optional_single_const_pointer,
817 .@"anyframe",
818 .anyframe_T,
819806 .anyerror_void_error_union,
820807 .error_set,
821808 .error_set_single,
......@@ -898,8 +885,6 @@ pub const Type = extern union {
898885 .mut_slice,
899886 .optional_single_const_pointer,
900887 .optional_single_mut_pointer,
901 .@"anyframe",
902 .anyframe_T,
903888 => return @divExact(target.cpu.arch.ptrBitWidth(), 8),
904889
905890 .pointer => {
......@@ -1025,7 +1010,7 @@ pub const Type = extern union {
10251010 .i64, .u64 => return 8,
10261011 .u128, .i128 => return 16,
10271012
1028 .@"anyframe", .anyframe_T, .isize, .usize => return @divExact(target.cpu.arch.ptrBitWidth(), 8),
1013 .isize, .usize => return @divExact(target.cpu.arch.ptrBitWidth(), 8),
10291014
10301015 .const_slice,
10311016 .mut_slice,
......@@ -1169,8 +1154,6 @@ pub const Type = extern union {
11691154 .const_slice,
11701155 .mut_slice,
11711156 .error_union,
1172 .@"anyframe",
1173 .anyframe_T,
11741157 .anyerror_void_error_union,
11751158 .error_set,
11761159 .error_set_single,
......@@ -1244,8 +1227,6 @@ pub const Type = extern union {
12441227 .optional_single_const_pointer,
12451228 .enum_literal,
12461229 .error_union,
1247 .@"anyframe",
1248 .anyframe_T,
12491230 .anyerror_void_error_union,
12501231 .error_set,
12511232 .error_set_single,
......@@ -1338,8 +1319,6 @@ pub const Type = extern union {
13381319 .optional_single_const_pointer,
13391320 .enum_literal,
13401321 .error_union,
1341 .@"anyframe",
1342 .anyframe_T,
13431322 .anyerror_void_error_union,
13441323 .error_set,
13451324 .error_set_single,
......@@ -1416,8 +1395,6 @@ pub const Type = extern union {
14161395 .enum_literal,
14171396 .mut_slice,
14181397 .error_union,
1419 .@"anyframe",
1420 .anyframe_T,
14211398 .anyerror_void_error_union,
14221399 .error_set,
14231400 .error_set_single,
......@@ -1503,8 +1480,6 @@ pub const Type = extern union {
15031480 .optional_single_const_pointer,
15041481 .enum_literal,
15051482 .error_union,
1506 .@"anyframe",
1507 .anyframe_T,
15081483 .anyerror_void_error_union,
15091484 .error_set,
15101485 .error_set_single,
......@@ -1585,8 +1560,6 @@ pub const Type = extern union {
15851560 .optional_single_const_pointer,
15861561 .enum_literal,
15871562 .error_union,
1588 .@"anyframe",
1589 .anyframe_T,
15901563 .anyerror_void_error_union,
15911564 .error_set,
15921565 .error_set_single,
......@@ -1709,8 +1682,6 @@ pub const Type = extern union {
17091682 .optional_single_mut_pointer => unreachable,
17101683 .enum_literal => unreachable,
17111684 .error_union => unreachable,
1712 .@"anyframe" => unreachable,
1713 .anyframe_T => unreachable,
17141685 .anyerror_void_error_union => unreachable,
17151686 .error_set => unreachable,
17161687 .error_set_single => unreachable,
......@@ -1859,8 +1830,6 @@ pub const Type = extern union {
18591830 .optional_single_const_pointer,
18601831 .enum_literal,
18611832 .error_union,
1862 .@"anyframe",
1863 .anyframe_T,
18641833 .anyerror_void_error_union,
18651834 .error_set,
18661835 .error_set_single,
......@@ -1931,8 +1900,6 @@ pub const Type = extern union {
19311900 .optional_single_const_pointer,
19321901 .enum_literal,
19331902 .error_union,
1934 .@"anyframe",
1935 .anyframe_T,
19361903 .anyerror_void_error_union,
19371904 .error_set,
19381905 .error_set_single,
......@@ -2018,8 +1985,6 @@ pub const Type = extern union {
20181985 .optional_single_const_pointer,
20191986 .enum_literal,
20201987 .error_union,
2021 .@"anyframe",
2022 .anyframe_T,
20231988 .anyerror_void_error_union,
20241989 .error_set,
20251990 .error_set_single,
......@@ -2101,8 +2066,6 @@ pub const Type = extern union {
21012066 .optional_single_const_pointer,
21022067 .enum_literal,
21032068 .error_union,
2104 .@"anyframe",
2105 .anyframe_T,
21062069 .anyerror_void_error_union,
21072070 .error_set,
21082071 .error_set_single,
......@@ -2170,8 +2133,6 @@ pub const Type = extern union {
21702133 .optional_single_const_pointer,
21712134 .enum_literal,
21722135 .error_union,
2173 .@"anyframe",
2174 .anyframe_T,
21752136 .anyerror_void_error_union,
21762137 .error_set,
21772138 .error_set_single,
......@@ -2267,8 +2228,6 @@ pub const Type = extern union {
22672228 .optional_single_const_pointer,
22682229 .enum_literal,
22692230 .error_union,
2270 .@"anyframe",
2271 .anyframe_T,
22722231 .anyerror_void_error_union,
22732232 .error_set,
22742233 .error_set_single,
......@@ -2385,8 +2344,6 @@ pub const Type = extern union {
23852344 .optional_single_const_pointer,
23862345 .enum_literal,
23872346 .error_union,
2388 .@"anyframe",
2389 .anyframe_T,
23902347 .anyerror_void_error_union,
23912348 .error_set,
23922349 .error_set_single,
......@@ -2469,8 +2426,6 @@ pub const Type = extern union {
24692426 .optional_single_const_pointer,
24702427 .enum_literal,
24712428 .error_union,
2472 .@"anyframe",
2473 .anyframe_T,
24742429 .anyerror_void_error_union,
24752430 .error_set,
24762431 .error_set_single,
......@@ -2552,8 +2507,6 @@ pub const Type = extern union {
25522507 .optional_single_const_pointer,
25532508 .enum_literal,
25542509 .error_union,
2555 .@"anyframe",
2556 .anyframe_T,
25572510 .anyerror_void_error_union,
25582511 .error_set,
25592512 .error_set_single,
......@@ -2635,8 +2588,6 @@ pub const Type = extern union {
26352588 .optional_single_const_pointer,
26362589 .enum_literal,
26372590 .error_union,
2638 .@"anyframe",
2639 .anyframe_T,
26402591 .anyerror_void_error_union,
26412592 .error_set,
26422593 .error_set_single,
......@@ -2715,8 +2666,6 @@ pub const Type = extern union {
27152666 .optional_single_const_pointer,
27162667 .enum_literal,
27172668 .error_union,
2718 .@"anyframe",
2719 .anyframe_T,
27202669 .anyerror_void_error_union,
27212670 .error_set,
27222671 .error_set_single,
......@@ -2795,8 +2744,6 @@ pub const Type = extern union {
27952744 .optional_single_const_pointer,
27962745 .enum_literal,
27972746 .error_union,
2798 .@"anyframe",
2799 .anyframe_T,
28002747 .anyerror_void_error_union,
28012748 .error_set,
28022749 .error_set_single,
......@@ -2875,8 +2822,6 @@ pub const Type = extern union {
28752822 .optional_single_const_pointer,
28762823 .enum_literal,
28772824 .error_union,
2878 .@"anyframe",
2879 .anyframe_T,
28802825 .anyerror_void_error_union,
28812826 .error_set,
28822827 .error_set_single,
......@@ -2939,8 +2884,6 @@ pub const Type = extern union {
29392884 .optional_single_const_pointer,
29402885 .enum_literal,
29412886 .anyerror_void_error_union,
2942 .anyframe_T,
2943 .@"anyframe",
29442887 .error_union,
29452888 .error_set,
29462889 .error_set_single,
......@@ -3047,8 +2990,6 @@ pub const Type = extern union {
30472990 .optional_single_const_pointer,
30482991 .enum_literal,
30492992 .error_union,
3050 .@"anyframe",
3051 .anyframe_T,
30522993 .anyerror_void_error_union,
30532994 .error_set,
30542995 .error_set_single,
......@@ -3136,8 +3077,6 @@ pub const Type = extern union {
31363077 .optional_single_const_pointer,
31373078 .enum_literal,
31383079 .error_union,
3139 .@"anyframe",
3140 .anyframe_T,
31413080 .anyerror_void_error_union,
31423081 .error_set,
31433082 .error_set_single,
......@@ -3259,7 +3198,6 @@ pub const Type = extern union {
32593198 fn_ccc_void_no_args,
32603199 single_const_pointer_to_comptime_int,
32613200 anyerror_void_error_union,
3262 @"anyframe",
32633201 const_slice_u8,
32643202 /// This is a special type for variadic parameters of a function call.
32653203 /// Casts to it will validate that the type can be passed to a c calling convetion function.
......@@ -3292,7 +3230,6 @@ pub const Type = extern union {
32923230 optional_single_mut_pointer,
32933231 optional_single_const_pointer,
32943232 error_union,
3295 anyframe_T,
32963233 error_set,
32973234 error_set_single,
32983235 empty_struct,
......@@ -3345,7 +3282,6 @@ pub const Type = extern union {
33453282 .fn_ccc_void_no_args,
33463283 .single_const_pointer_to_comptime_int,
33473284 .anyerror_void_error_union,
3348 .@"anyframe",
33493285 .const_slice_u8,
33503286 .inferred_alloc_const,
33513287 .inferred_alloc_mut,
......@@ -3367,7 +3303,6 @@ pub const Type = extern union {
33673303 .optional,
33683304 .optional_single_mut_pointer,
33693305 .optional_single_const_pointer,
3370 .anyframe_T,
33713306 => Payload.ElemType,
33723307
33733308 .int_signed,
src/value.zig-18
......@@ -62,7 +62,6 @@ pub const Value = extern union {
6262 single_const_pointer_to_comptime_int_type,
6363 const_slice_u8_type,
6464 enum_literal_type,
65 anyframe_type,
6665
6766 undef,
6867 zero,
......@@ -153,7 +152,6 @@ pub const Value = extern union {
153152 .single_const_pointer_to_comptime_int_type,
154153 .const_slice_u8_type,
155154 .enum_literal_type,
156 .anyframe_type,
157155 .undef,
158156 .zero,
159157 .one,
......@@ -308,7 +306,6 @@ pub const Value = extern union {
308306 .single_const_pointer_to_comptime_int_type,
309307 .const_slice_u8_type,
310308 .enum_literal_type,
311 .anyframe_type,
312309 .undef,
313310 .zero,
314311 .one,
......@@ -462,7 +459,6 @@ pub const Value = extern union {
462459 .single_const_pointer_to_comptime_int_type => return out_stream.writeAll("*const comptime_int"),
463460 .const_slice_u8_type => return out_stream.writeAll("[]const u8"),
464461 .enum_literal_type => return out_stream.writeAll("@Type(.EnumLiteral)"),
465 .anyframe_type => return out_stream.writeAll("anyframe"),
466462
467463 // TODO this should print `NAME{}`
468464 .empty_struct_value => return out_stream.writeAll("struct {}{}"),
......@@ -590,7 +586,6 @@ pub const Value = extern union {
590586 .single_const_pointer_to_comptime_int_type => Type.initTag(.single_const_pointer_to_comptime_int),
591587 .const_slice_u8_type => Type.initTag(.const_slice_u8),
592588 .enum_literal_type => Type.initTag(.enum_literal),
593 .anyframe_type => Type.initTag(.@"anyframe"),
594589
595590 .int_type => {
596591 const payload = self.castTag(.int_type).?.data;
......@@ -687,7 +682,6 @@ pub const Value = extern union {
687682 .single_const_pointer_to_comptime_int_type,
688683 .const_slice_u8_type,
689684 .enum_literal_type,
690 .anyframe_type,
691685 .null_value,
692686 .function,
693687 .extern_fn,
......@@ -774,7 +768,6 @@ pub const Value = extern union {
774768 .single_const_pointer_to_comptime_int_type,
775769 .const_slice_u8_type,
776770 .enum_literal_type,
777 .anyframe_type,
778771 .null_value,
779772 .function,
780773 .extern_fn,
......@@ -861,7 +854,6 @@ pub const Value = extern union {
861854 .single_const_pointer_to_comptime_int_type,
862855 .const_slice_u8_type,
863856 .enum_literal_type,
864 .anyframe_type,
865857 .null_value,
866858 .function,
867859 .extern_fn,
......@@ -975,7 +967,6 @@ pub const Value = extern union {
975967 .single_const_pointer_to_comptime_int_type,
976968 .const_slice_u8_type,
977969 .enum_literal_type,
978 .anyframe_type,
979970 .null_value,
980971 .function,
981972 .extern_fn,
......@@ -1067,7 +1058,6 @@ pub const Value = extern union {
10671058 .single_const_pointer_to_comptime_int_type,
10681059 .const_slice_u8_type,
10691060 .enum_literal_type,
1070 .anyframe_type,
10711061 .null_value,
10721062 .function,
10731063 .extern_fn,
......@@ -1224,7 +1214,6 @@ pub const Value = extern union {
12241214 .single_const_pointer_to_comptime_int_type,
12251215 .const_slice_u8_type,
12261216 .enum_literal_type,
1227 .anyframe_type,
12281217 .bool_true,
12291218 .bool_false,
12301219 .null_value,
......@@ -1308,7 +1297,6 @@ pub const Value = extern union {
13081297 .single_const_pointer_to_comptime_int_type,
13091298 .const_slice_u8_type,
13101299 .enum_literal_type,
1311 .anyframe_type,
13121300 .null_value,
13131301 .function,
13141302 .extern_fn,
......@@ -1460,7 +1448,6 @@ pub const Value = extern union {
14601448 .single_const_pointer_to_comptime_int_type,
14611449 .const_slice_u8_type,
14621450 .enum_literal_type,
1463 .anyframe_type,
14641451 .ty,
14651452 => {
14661453 // Directly return Type.hash, toType can only fail for .int_type and .error_set.
......@@ -1618,7 +1605,6 @@ pub const Value = extern union {
16181605 .single_const_pointer_to_comptime_int_type,
16191606 .const_slice_u8_type,
16201607 .enum_literal_type,
1621 .anyframe_type,
16221608 .zero,
16231609 .one,
16241610 .bool_true,
......@@ -1705,7 +1691,6 @@ pub const Value = extern union {
17051691 .single_const_pointer_to_comptime_int_type,
17061692 .const_slice_u8_type,
17071693 .enum_literal_type,
1708 .anyframe_type,
17091694 .zero,
17101695 .one,
17111696 .bool_true,
......@@ -1809,7 +1794,6 @@ pub const Value = extern union {
18091794 .single_const_pointer_to_comptime_int_type,
18101795 .const_slice_u8_type,
18111796 .enum_literal_type,
1812 .anyframe_type,
18131797 .zero,
18141798 .one,
18151799 .empty_array,
......@@ -1891,7 +1875,6 @@ pub const Value = extern union {
18911875 .single_const_pointer_to_comptime_int_type,
18921876 .const_slice_u8_type,
18931877 .enum_literal_type,
1894 .anyframe_type,
18951878 .zero,
18961879 .one,
18971880 .null_value,
......@@ -1993,7 +1976,6 @@ pub const Value = extern union {
19931976 .single_const_pointer_to_comptime_int_type,
19941977 .const_slice_u8_type,
19951978 .enum_literal_type,
1996 .anyframe_type,
19971979 .error_set,
19981980 => true,
19991981
src/zir.zig-40
......@@ -161,7 +161,6 @@ pub const Const = enum {
161161 single_const_pointer_to_comptime_int_type,
162162 const_slice_u8_type,
163163 enum_literal_type,
164 anyframe_type,
165164
166165 /// `undefined` (untyped)
167166 undef,
......@@ -343,10 +342,6 @@ pub const const_inst_list = std.enums.directEnumArray(Const, TypedValue, 0, .{
343342 .ty = Type.initTag(.type),
344343 .val = Value.initTag(.enum_literal_type),
345344 },
346 .anyframe_type = .{
347 .ty = Type.initTag(.type),
348 .val = Value.initTag(.anyframe_type),
349 },
350345
351346 .undef = .{
352347 .ty = Type.initTag(.@"undefined"),
......@@ -409,9 +404,6 @@ pub const Inst = struct {
409404 alloc_inferred,
410405 /// Same as `alloc_inferred` except mutable.
411406 alloc_inferred_mut,
412 /// Create an `anyframe->T`.
413 /// Uses the `un_node` field. AST node is the `anyframe->T` syntax. Operand is the type.
414 anyframe_type,
415407 /// Array concatenation. `a ++ b`
416408 /// Uses the `pl_node` union field. Payload is `Bin`.
417409 array_cat,
......@@ -441,8 +433,6 @@ pub const Inst = struct {
441433 /// Inline assembly with the volatile attribute.
442434 /// Uses the `pl_node` union field. Payload is `Asm`. AST node is the assembly node.
443435 asm_volatile,
444 /// `await x` syntax. Uses the `un_node` union field.
445 @"await",
446436 /// Bitwise AND. `&`
447437 bit_and,
448438 /// TODO delete this instruction, it has no purpose.
......@@ -495,10 +485,6 @@ pub const Inst = struct {
495485 /// Function call with modifier `.auto`.
496486 /// Uses `pl_node`. AST node is the function call. Payload is `Call`.
497487 call,
498 /// Same as `call` but with modifier `.async_kw`.
499 call_async_kw,
500 /// Same as `call` but with modifier `.no_async`.
501 call_no_async,
502488 /// Same as `call` but with modifier `.compile_time`.
503489 call_compile_time,
504490 /// Function call with modifier `.auto`, empty parameter list.
......@@ -666,8 +652,6 @@ pub const Inst = struct {
666652 /// Twos complement wrapping integer multiplication.
667653 /// Uses the `pl_node` union field. Payload is `Bin`.
668654 mulwrap,
669 /// An await inside a nosuspend scope.
670 nosuspend_await,
671655 /// Given a reference to a function and a parameter index, returns the
672656 /// type of the parameter. The only usage of this instruction is for the
673657 /// result location of parameters of function calls. In the case of a function's
......@@ -686,8 +670,6 @@ pub const Inst = struct {
686670 /// instruction.
687671 /// Uses the `un_tok` union field.
688672 ref,
689 /// Resume an async function.
690 @"resume",
691673 /// Obtains a pointer to the return value.
692674 /// Uses the `node` union field.
693675 ret_ptr,
......@@ -841,12 +823,6 @@ pub const Inst = struct {
841823 /// An enum literal 8 or fewer bytes. No source location.
842824 /// Uses the `small_str` field.
843825 enum_literal_small,
844 /// Suspend an async function. The suspend block has 0 or 1 statements in it.
845 /// Uses the `un_node` union field.
846 suspend_block_one,
847 /// Suspend an async function. The suspend block has any number of statements in it.
848 /// Uses the `pl_node` union field. Payload is `MultiOp`.
849 suspend_block,
850826 // /// A switch expression.
851827 // /// lhs is target, SwitchBr[rhs]
852828 // /// All prongs of target handled.
......@@ -918,8 +894,6 @@ pub const Inst = struct {
918894 .bool_or,
919895 .breakpoint,
920896 .call,
921 .call_async_kw,
922 .call_no_async,
923897 .call_compile_time,
924898 .call_none,
925899 .cmp_lt,
......@@ -997,7 +971,6 @@ pub const Inst = struct {
997971 .enum_literal,
998972 .enum_literal_small,
999973 .merge_error_sets,
1000 .anyframe_type,
1001974 .error_union_type,
1002975 .bit_not,
1003976 .error_set,
......@@ -1010,9 +983,6 @@ pub const Inst = struct {
1010983 .resolve_inferred_alloc,
1011984 .set_eval_branch_quota,
1012985 .compile_log,
1013 .@"resume",
1014 .@"await",
1015 .nosuspend_await,
1016986 .elided,
1017987 => false,
1018988
......@@ -1025,8 +995,6 @@ pub const Inst = struct {
1025995 .ret_coerce,
1026996 .@"unreachable",
1027997 .loop,
1028 .suspend_block,
1029 .suspend_block_one,
1030998 => true,
1031999 };
10321000 }
......@@ -1347,9 +1315,7 @@ const Writer = struct {
13471315 .alloc_mut,
13481316 .alloc_inferred,
13491317 .alloc_inferred_mut,
1350 .anyframe_type,
13511318 .indexable_ptr_len,
1352 .@"await",
13531319 .bit_not,
13541320 .bool_not,
13551321 .negate,
......@@ -1364,7 +1330,6 @@ const Writer = struct {
13641330 .ret_node,
13651331 .set_eval_branch_quota,
13661332 .resolve_inferred_alloc,
1367 .suspend_block_one,
13681333 .optional_type,
13691334 .optional_type_from_ptr_elem,
13701335 .optional_payload_safe,
......@@ -1409,8 +1374,6 @@ const Writer = struct {
14091374 .block_comptime,
14101375 .block_comptime_flat,
14111376 .call,
1412 .call_async_kw,
1413 .call_no_async,
14141377 .call_compile_time,
14151378 .compile_log,
14161379 .condbr,
......@@ -1426,7 +1389,6 @@ const Writer = struct {
14261389 .slice_end,
14271390 .slice_sentinel,
14281391 .typeof_peer,
1429 .suspend_block,
14301392 => try self.writePlNode(stream, inst),
14311393
14321394 .add,
......@@ -1481,8 +1443,6 @@ const Writer = struct {
14811443 .bitcast_result_ptr,
14821444 .error_union_type,
14831445 .error_set,
1484 .nosuspend_await,
1485 .@"resume",
14861446 .store,
14871447 .store_to_block_ptr,
14881448 .store_to_inferred_ptr,