authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-21 13:16:03-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-21 17:03:03-07:00
loga51ff3a9033d6befabdd3d80374f6bf2a6bbb62e
treec2f6a359483adc190667ea123b0b5360e26096bf
parentb9b0e53197a977be6cecca29366bd1e758e66be8

AstGen: remove unused scope parameter from rvalue


1 files changed, 125 insertions(+), 132 deletions(-)

src/AstGen.zig+125-132
......@@ -481,61 +481,61 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
481481
482482 .assign => {
483483 try assign(gz, scope, node);
484 return rvalue(gz, scope, rl, .void_value, node);
484 return rvalue(gz, rl, .void_value, node);
485485 },
486486
487487 .assign_bit_shift_left => {
488488 try assignShift(gz, scope, node, .shl);
489 return rvalue(gz, scope, rl, .void_value, node);
489 return rvalue(gz, rl, .void_value, node);
490490 },
491491 .assign_bit_shift_right => {
492492 try assignShift(gz, scope, node, .shr);
493 return rvalue(gz, scope, rl, .void_value, node);
493 return rvalue(gz, rl, .void_value, node);
494494 },
495495
496496 .assign_bit_and => {
497497 try assignOp(gz, scope, node, .bit_and);
498 return rvalue(gz, scope, rl, .void_value, node);
498 return rvalue(gz, rl, .void_value, node);
499499 },
500500 .assign_bit_or => {
501501 try assignOp(gz, scope, node, .bit_or);
502 return rvalue(gz, scope, rl, .void_value, node);
502 return rvalue(gz, rl, .void_value, node);
503503 },
504504 .assign_bit_xor => {
505505 try assignOp(gz, scope, node, .xor);
506 return rvalue(gz, scope, rl, .void_value, node);
506 return rvalue(gz, rl, .void_value, node);
507507 },
508508 .assign_div => {
509509 try assignOp(gz, scope, node, .div);
510 return rvalue(gz, scope, rl, .void_value, node);
510 return rvalue(gz, rl, .void_value, node);
511511 },
512512 .assign_sub => {
513513 try assignOp(gz, scope, node, .sub);
514 return rvalue(gz, scope, rl, .void_value, node);
514 return rvalue(gz, rl, .void_value, node);
515515 },
516516 .assign_sub_wrap => {
517517 try assignOp(gz, scope, node, .subwrap);
518 return rvalue(gz, scope, rl, .void_value, node);
518 return rvalue(gz, rl, .void_value, node);
519519 },
520520 .assign_mod => {
521521 try assignOp(gz, scope, node, .mod_rem);
522 return rvalue(gz, scope, rl, .void_value, node);
522 return rvalue(gz, rl, .void_value, node);
523523 },
524524 .assign_add => {
525525 try assignOp(gz, scope, node, .add);
526 return rvalue(gz, scope, rl, .void_value, node);
526 return rvalue(gz, rl, .void_value, node);
527527 },
528528 .assign_add_wrap => {
529529 try assignOp(gz, scope, node, .addwrap);
530 return rvalue(gz, scope, rl, .void_value, node);
530 return rvalue(gz, rl, .void_value, node);
531531 },
532532 .assign_mul => {
533533 try assignOp(gz, scope, node, .mul);
534 return rvalue(gz, scope, rl, .void_value, node);
534 return rvalue(gz, rl, .void_value, node);
535535 },
536536 .assign_mul_wrap => {
537537 try assignOp(gz, scope, node, .mulwrap);
538 return rvalue(gz, scope, rl, .void_value, node);
538 return rvalue(gz, rl, .void_value, node);
539539 },
540540
541541 // zig fmt: off
......@@ -659,7 +659,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
659659 .lhs = lhs,
660660 .start = start,
661661 });
662 return rvalue(gz, scope, rl, result, node);
662 return rvalue(gz, rl, result, node);
663663 },
664664 .slice => {
665665 const lhs = try expr(gz, scope, .ref, node_datas[node].lhs);
......@@ -671,7 +671,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
671671 .start = start,
672672 .end = end,
673673 });
674 return rvalue(gz, scope, rl, result, node);
674 return rvalue(gz, rl, result, node);
675675 },
676676 .slice_sentinel => {
677677 const lhs = try expr(gz, scope, .ref, node_datas[node].lhs);
......@@ -685,7 +685,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
685685 .end = end,
686686 .sentinel = sentinel,
687687 });
688 return rvalue(gz, scope, rl, result, node);
688 return rvalue(gz, rl, result, node);
689689 },
690690
691691 .deref => {
......@@ -694,22 +694,22 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
694694 .ref, .none_or_ref => return lhs,
695695 else => {
696696 const result = try gz.addUnNode(.load, lhs, node);
697 return rvalue(gz, scope, rl, result, node);
697 return rvalue(gz, rl, result, node);
698698 },
699699 }
700700 },
701701 .address_of => {
702702 const result = try expr(gz, scope, .ref, node_datas[node].lhs);
703 return rvalue(gz, scope, rl, result, node);
703 return rvalue(gz, rl, result, node);
704704 },
705 .undefined_literal => return rvalue(gz, scope, rl, .undef, node),
706 .true_literal => return rvalue(gz, scope, rl, .bool_true, node),
707 .false_literal => return rvalue(gz, scope, rl, .bool_false, node),
708 .null_literal => return rvalue(gz, scope, rl, .null_value, node),
705 .undefined_literal => return rvalue(gz, rl, .undef, node),
706 .true_literal => return rvalue(gz, rl, .bool_true, node),
707 .false_literal => return rvalue(gz, rl, .bool_false, node),
708 .null_literal => return rvalue(gz, rl, .null_value, node),
709709 .optional_type => {
710710 const operand = try typeExpr(gz, scope, node_datas[node].lhs);
711711 const result = try gz.addUnNode(.optional_type, operand, node);
712 return rvalue(gz, scope, rl, result, node);
712 return rvalue(gz, rl, result, node);
713713 },
714714 .unwrap_optional => switch (rl) {
715715 .ref => return gz.addUnNode(
......@@ -717,7 +717,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
717717 try expr(gz, scope, .ref, node_datas[node].lhs),
718718 node,
719719 ),
720 else => return rvalue(gz, scope, rl, try gz.addUnNode(
720 else => return rvalue(gz, rl, try gz.addUnNode(
721721 .optional_payload_safe,
722722 try expr(gz, scope, .none, node_datas[node].lhs),
723723 node,
......@@ -739,11 +739,11 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
739739 },
740740 .enum_literal => return simpleStrTok(gz, scope, rl, main_tokens[node], node, .enum_literal),
741741 .error_value => return simpleStrTok(gz, scope, rl, node_datas[node].rhs, node, .error_value),
742 .anyframe_literal => return rvalue(gz, scope, rl, .anyframe_type, node),
742 .anyframe_literal => return rvalue(gz, rl, .anyframe_type, node),
743743 .anyframe_type => {
744744 const return_type = try typeExpr(gz, scope, node_datas[node].rhs);
745745 const result = try gz.addUnNode(.anyframe_type, return_type, node);
746 return rvalue(gz, scope, rl, result, node);
746 return rvalue(gz, rl, result, node);
747747 },
748748 .@"catch" => {
749749 const catch_token = main_tokens[node];
......@@ -916,7 +916,7 @@ fn nosuspendExpr(
916916 gz.nosuspend_node = node;
917917 const result = try expr(gz, scope, rl, body_node);
918918 gz.nosuspend_node = 0;
919 return rvalue(gz, scope, rl, result, node);
919 return rvalue(gz, rl, result, node);
920920}
921921
922922fn suspendExpr(
......@@ -977,7 +977,7 @@ fn awaitExpr(
977977 const operand = try expr(gz, scope, .none, rhs_node);
978978 const tag: Zir.Inst.Tag = if (gz.nosuspend_node != 0) .await_nosuspend else .@"await";
979979 const result = try gz.addUnNode(tag, operand, node);
980 return rvalue(gz, scope, rl, result, node);
980 return rvalue(gz, rl, result, node);
981981}
982982
983983fn resumeExpr(
......@@ -992,7 +992,7 @@ fn resumeExpr(
992992 const rhs_node = node_datas[node].lhs;
993993 const operand = try expr(gz, scope, .none, rhs_node);
994994 const result = try gz.addUnNode(.@"resume", operand, node);
995 return rvalue(gz, scope, rl, result, node);
995 return rvalue(gz, rl, result, node);
996996}
997997
998998fn fnProtoExpr(
......@@ -1098,7 +1098,7 @@ fn fnProtoExpr(
10981098 .is_test = false,
10991099 .is_extern = false,
11001100 });
1101 return rvalue(gz, scope, rl, result, fn_proto.ast.proto_node);
1101 return rvalue(gz, rl, result, fn_proto.ast.proto_node);
11021102}
11031103
11041104fn arrayInitExpr(
......@@ -1184,7 +1184,7 @@ fn arrayInitExpr(
11841184 .ty => |ty_inst| {
11851185 if (types.array != .none) {
11861186 const result = try arrayInitExprRlTy(gz, scope, node, array_init.ast.elements, types.elem, .array_init);
1187 return rvalue(gz, scope, rl, result, node);
1187 return rvalue(gz, rl, result, node);
11881188 } else {
11891189 const elem_type = try gz.addUnNode(.elem_type, ty_inst, node);
11901190 return arrayInitExprRlTy(gz, scope, node, array_init.ast.elements, elem_type, .array_init);
......@@ -1288,7 +1288,7 @@ fn structInitExpr(
12881288
12891289 if (struct_init.ast.fields.len == 0) {
12901290 if (struct_init.ast.type_expr == 0) {
1291 return rvalue(gz, scope, rl, .empty_struct, node);
1291 return rvalue(gz, rl, .empty_struct, node);
12921292 }
12931293 array: {
12941294 const node_tags = tree.nodes.items(.tag);
......@@ -1310,12 +1310,12 @@ fn structInitExpr(
13101310 break :blk try gz.addArrayTypeSentinel(.zero_usize, elem_type, sentinel);
13111311 };
13121312 const result = try gz.addUnNode(.struct_init_empty, array_type_inst, node);
1313 return rvalue(gz, scope, rl, result, node);
1313 return rvalue(gz, rl, result, node);
13141314 }
13151315 }
13161316 const ty_inst = try typeExpr(gz, scope, struct_init.ast.type_expr);
13171317 const result = try gz.addUnNode(.struct_init_empty, ty_inst, node);
1318 return rvalue(gz, scope, rl, result, node);
1318 return rvalue(gz, rl, result, node);
13191319 }
13201320 switch (rl) {
13211321 .discard => {
......@@ -1348,7 +1348,7 @@ fn structInitExpr(
13481348 }
13491349 const inner_ty_inst = try typeExpr(gz, scope, struct_init.ast.type_expr);
13501350 const result = try structInitExprRlTy(gz, scope, node, struct_init, inner_ty_inst, .struct_init);
1351 return rvalue(gz, scope, rl, result, node);
1351 return rvalue(gz, rl, result, node);
13521352 },
13531353 .ptr, .inferred_ptr => |ptr_inst| return structInitExprRlPtr(gz, scope, node, struct_init, ptr_inst),
13541354 .block_ptr => |block_gz| return structInitExprRlPtr(gz, scope, node, struct_init, block_gz.rl_ptr),
......@@ -1651,7 +1651,7 @@ fn blockExpr(
16511651 }
16521652
16531653 try blockExprStmts(gz, scope, statements);
1654 return rvalue(gz, scope, rl, .void_value, block_node);
1654 return rvalue(gz, rl, .void_value, block_node);
16551655}
16561656
16571657fn checkLabelRedefinition(astgen: *AstGen, parent_scope: *Scope, label: ast.TokenIndex) !void {
......@@ -1761,7 +1761,7 @@ fn labeledBlockExpr(
17611761 const block_ref = gz.indexToRef(block_inst);
17621762 switch (rl) {
17631763 .ref => return block_ref,
1764 else => return rvalue(gz, parent_scope, rl, block_ref, block_node),
1764 else => return rvalue(gz, rl, block_ref, block_node),
17651765 }
17661766 },
17671767 }
......@@ -2560,7 +2560,7 @@ fn boolNot(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) Inne
25602560
25612561 const operand = try expr(gz, scope, bool_rl, node_datas[node].lhs);
25622562 const result = try gz.addUnNode(.bool_not, operand, node);
2563 return rvalue(gz, scope, rl, result, node);
2563 return rvalue(gz, rl, result, node);
25642564}
25652565
25662566fn bitNot(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerError!Zir.Inst.Ref {
......@@ -2570,7 +2570,7 @@ fn bitNot(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) Inner
25702570
25712571 const operand = try expr(gz, scope, .none, node_datas[node].lhs);
25722572 const result = try gz.addUnNode(.bit_not, operand, node);
2573 return rvalue(gz, scope, rl, result, node);
2573 return rvalue(gz, rl, result, node);
25742574}
25752575
25762576fn negation(
......@@ -2586,7 +2586,7 @@ fn negation(
25862586
25872587 const operand = try expr(gz, scope, .none, node_datas[node].lhs);
25882588 const result = try gz.addUnNode(tag, operand, node);
2589 return rvalue(gz, scope, rl, result, node);
2589 return rvalue(gz, rl, result, node);
25902590}
25912591
25922592fn ptrType(
......@@ -2612,7 +2612,7 @@ fn ptrType(
26122612 .elem_type = elem_type,
26132613 },
26142614 } });
2615 return rvalue(gz, scope, rl, result, node);
2615 return rvalue(gz, rl, result, node);
26162616 }
26172617
26182618 var sentinel_ref: Zir.Inst.Ref = .none;
......@@ -2672,7 +2672,7 @@ fn ptrType(
26722672 } });
26732673 gz.instructions.appendAssumeCapacity(new_index);
26742674
2675 return rvalue(gz, scope, rl, result, node);
2675 return rvalue(gz, rl, result, node);
26762676}
26772677
26782678fn arrayType(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) !Zir.Inst.Ref {
......@@ -2692,7 +2692,7 @@ fn arrayType(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) !Z
26922692 const elem_type = try typeExpr(gz, scope, node_datas[node].rhs);
26932693
26942694 const result = try gz.addBin(.array_type, len, elem_type);
2695 return rvalue(gz, scope, rl, result, node);
2695 return rvalue(gz, rl, result, node);
26962696}
26972697
26982698fn arrayTypeSentinel(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) !Zir.Inst.Ref {
......@@ -2714,7 +2714,7 @@ fn arrayTypeSentinel(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.I
27142714 const sentinel = try expr(gz, scope, .{ .ty = elem_type }, extra.sentinel);
27152715
27162716 const result = try gz.addArrayTypeSentinel(len, elem_type, sentinel);
2717 return rvalue(gz, scope, rl, result, node);
2717 return rvalue(gz, rl, result, node);
27182718}
27192719
27202720const WipDecls = struct {
......@@ -3950,7 +3950,7 @@ fn containerDecl(
39503950 assert(arg_inst == .none);
39513951
39523952 const result = try structDeclInner(gz, scope, node, container_decl, layout);
3953 return rvalue(gz, scope, rl, result, node);
3953 return rvalue(gz, rl, result, node);
39543954 },
39553955 .keyword_union => {
39563956 const layout = if (container_decl.layout_token) |t| switch (token_tags[t]) {
......@@ -3962,7 +3962,7 @@ fn containerDecl(
39623962 const have_auto_enum = container_decl.ast.enum_token != null;
39633963
39643964 const result = try unionDeclInner(gz, scope, node, container_decl.ast.members, layout, arg_inst, have_auto_enum);
3965 return rvalue(gz, scope, rl, result, node);
3965 return rvalue(gz, rl, result, node);
39663966 },
39673967 .keyword_enum => {
39683968 if (container_decl.layout_token) |t| {
......@@ -4291,7 +4291,7 @@ fn containerDecl(
42914291 astgen.extra.appendAssumeCapacity(cur_bit_bag);
42924292 astgen.extra.appendSliceAssumeCapacity(fields_data.items);
42934293
4294 return rvalue(gz, scope, rl, gz.indexToRef(decl_inst), node);
4294 return rvalue(gz, rl, gz.indexToRef(decl_inst), node);
42954295 },
42964296 .keyword_opaque => {
42974297 var namespace: Scope.Namespace = .{ .parent = scope };
......@@ -4452,7 +4452,7 @@ fn containerDecl(
44524452 }
44534453 astgen.extra.appendSliceAssumeCapacity(wip_decls.payload.items);
44544454
4455 return rvalue(gz, scope, rl, gz.indexToRef(decl_inst), node);
4455 return rvalue(gz, rl, gz.indexToRef(decl_inst), node);
44564456 },
44574457 else => unreachable,
44584458 }
......@@ -4495,7 +4495,7 @@ fn errorSetDecl(
44954495 .fields_len = @intCast(u32, field_names.items.len),
44964496 });
44974497 try astgen.extra.appendSlice(gpa, field_names.items);
4498 return rvalue(gz, scope, rl, result, node);
4498 return rvalue(gz, rl, result, node);
44994499}
45004500
45014501fn tryExpr(
......@@ -4554,7 +4554,7 @@ fn tryExpr(
45544554 const unwrapped_payload = try else_scope.addUnNode(err_ops[2], operand, node);
45554555 const else_result = switch (rl) {
45564556 .ref => unwrapped_payload,
4557 else => try rvalue(&else_scope, &else_scope.base, block_scope.break_result_loc, unwrapped_payload, node),
4557 else => try rvalue(&else_scope, block_scope.break_result_loc, unwrapped_payload, node),
45584558 };
45594559
45604560 return finishThenElseBlock(
......@@ -4647,7 +4647,7 @@ fn orelseCatchExpr(
46474647 const unwrapped_payload = try else_scope.addUnNode(unwrap_op, operand, node);
46484648 const else_result = switch (rl) {
46494649 .ref => unwrapped_payload,
4650 else => try rvalue(&else_scope, &else_scope.base, block_scope.break_result_loc, unwrapped_payload, node),
4650 else => try rvalue(&else_scope, block_scope.break_result_loc, unwrapped_payload, node),
46514651 };
46524652
46534653 return finishThenElseBlock(
......@@ -4719,7 +4719,7 @@ fn finishThenElseBlock(
47194719 const block_ref = parent_gz.indexToRef(main_block);
47204720 switch (rl) {
47214721 .ref => return block_ref,
4722 else => return rvalue(parent_gz, parent_scope, rl, block_ref, node),
4722 else => return rvalue(parent_gz, rl, block_ref, node),
47234723 }
47244724 },
47254725 }
......@@ -4755,7 +4755,7 @@ fn fieldAccess(
47554755 .lhs = try expr(gz, scope, .ref, object_node),
47564756 .field_name_start = str_index,
47574757 }),
4758 else => return rvalue(gz, scope, rl, try gz.addPlNode(.field_val, node, Zir.Inst.Field{
4758 else => return rvalue(gz, rl, try gz.addPlNode(.field_val, node, Zir.Inst.Field{
47594759 .lhs = try expr(gz, scope, .none_or_ref, object_node),
47604760 .field_name_start = str_index,
47614761 }), node),
......@@ -4777,7 +4777,7 @@ fn arrayAccess(
47774777 try expr(gz, scope, .ref, node_datas[node].lhs),
47784778 try expr(gz, scope, .{ .ty = .usize_type }, node_datas[node].rhs),
47794779 ),
4780 else => return rvalue(gz, scope, rl, try gz.addBin(
4780 else => return rvalue(gz, rl, try gz.addBin(
47814781 .elem_val,
47824782 try expr(gz, scope, .none_or_ref, node_datas[node].lhs),
47834783 try expr(gz, scope, .{ .ty = .usize_type }, node_datas[node].rhs),
......@@ -4800,7 +4800,7 @@ fn simpleBinOp(
48004800 .lhs = try expr(gz, scope, .none, node_datas[node].lhs),
48014801 .rhs = try expr(gz, scope, .none, node_datas[node].rhs),
48024802 });
4803 return rvalue(gz, scope, rl, result, node);
4803 return rvalue(gz, rl, result, node);
48044804}
48054805
48064806fn simpleStrTok(
......@@ -4814,7 +4814,7 @@ fn simpleStrTok(
48144814 const astgen = gz.astgen;
48154815 const str_index = try astgen.identAsString(ident_token);
48164816 const result = try gz.addStrTok(op_inst_tag, str_index, ident_token);
4817 return rvalue(gz, scope, rl, result, node);
4817 return rvalue(gz, rl, result, node);
48184818}
48194819
48204820fn boolBinOp(
......@@ -4840,7 +4840,7 @@ fn boolBinOp(
48404840 try rhs_scope.setBoolBrBody(bool_br);
48414841
48424842 const block_ref = gz.indexToRef(bool_br);
4843 return rvalue(gz, scope, rl, block_ref, node);
4843 return rvalue(gz, rl, block_ref, node);
48444844}
48454845
48464846fn ifExpr(
......@@ -6010,7 +6010,7 @@ fn switchExpr(
60106010 const block_ref = parent_gz.indexToRef(switch_block);
60116011 switch (rl) {
60126012 .ref => return block_ref,
6013 else => return rvalue(parent_gz, scope, rl, block_ref, switch_node),
6013 else => return rvalue(parent_gz, rl, block_ref, switch_node),
60146014 }
60156015 },
60166016 .break_void => {
......@@ -6151,7 +6151,7 @@ fn identifier(
61516151 }
61526152
61536153 if (simple_types.get(ident_name)) |zir_const_ref| {
6154 return rvalue(gz, scope, rl, zir_const_ref, ident);
6154 return rvalue(gz, rl, zir_const_ref, ident);
61556155 }
61566156
61576157 if (ident_name.len >= 2) integer: {
......@@ -6177,7 +6177,7 @@ fn identifier(
61776177 .bit_count = bit_count,
61786178 } },
61796179 });
6180 return rvalue(gz, scope, rl, result, ident);
6180 return rvalue(gz, rl, result, ident);
61816181 }
61826182 }
61836183
......@@ -6196,7 +6196,7 @@ fn identifier(
61966196 // Captures of non-locals need to be emitted as decl_val or decl_ref.
61976197 // This *might* be capturable depending on if it is comptime known.
61986198 if (!hit_namespace) {
6199 return rvalue(gz, scope, rl, local_val.inst, ident);
6199 return rvalue(gz, rl, local_val.inst, ident);
62006200 }
62016201 }
62026202 s = local_val.parent;
......@@ -6220,7 +6220,7 @@ fn identifier(
62206220 .ref, .none_or_ref => return local_ptr.ptr,
62216221 else => {
62226222 const loaded = try gz.addUnNode(.load, local_ptr.ptr, ident);
6223 return rvalue(gz, scope, rl, loaded, ident);
6223 return rvalue(gz, rl, loaded, ident);
62246224 },
62256225 }
62266226 }
......@@ -6254,7 +6254,7 @@ fn identifier(
62546254 .ref, .none_or_ref => return gz.addStrTok(.decl_ref, name_str_index, ident_token),
62556255 else => {
62566256 const result = try gz.addStrTok(.decl_val, name_str_index, ident_token);
6257 return rvalue(gz, scope, rl, result, ident);
6257 return rvalue(gz, rl, result, ident);
62586258 },
62596259 }
62606260}
......@@ -6277,7 +6277,7 @@ fn stringLiteral(
62776277 .len = str.len,
62786278 } },
62796279 });
6280 return rvalue(gz, scope, rl, result, node);
6280 return rvalue(gz, rl, result, node);
62816281}
62826282
62836283fn multilineStringLiteral(
......@@ -6320,7 +6320,7 @@ fn multilineStringLiteral(
63206320 .len = @intCast(u32, string_bytes.items.len - str_index),
63216321 } },
63226322 });
6323 return rvalue(gz, scope, rl, result, node);
6323 return rvalue(gz, rl, result, node);
63246324}
63256325
63266326fn charLiteral(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) !Zir.Inst.Ref {
......@@ -6343,7 +6343,7 @@ fn charLiteral(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index)
63436343 },
63446344 };
63456345 const result = try gz.addInt(value);
6346 return rvalue(gz, scope, rl, result, node);
6346 return rvalue(gz, rl, result, node);
63476347}
63486348
63496349fn integerLiteral(
......@@ -6363,7 +6363,7 @@ fn integerLiteral(
63636363 1 => .one,
63646364 else => try gz.addInt(small_int),
63656365 };
6366 return rvalue(gz, scope, rl, result, node);
6366 return rvalue(gz, rl, result, node);
63676367 } else |err| switch (err) {
63686368 error.InvalidCharacter => unreachable, // Caught by the parser.
63696369 error.Overflow => {},
......@@ -6394,7 +6394,7 @@ fn integerLiteral(
63946394 const limbs = big_int.limbs[0..big_int.len()];
63956395 assert(big_int.isPositive());
63966396 const result = try gz.addIntBig(limbs);
6397 return rvalue(gz, scope, rl, result, node);
6397 return rvalue(gz, rl, result, node);
63986398}
63996399
64006400fn floatLiteral(
......@@ -6424,7 +6424,7 @@ fn floatLiteral(
64246424 const bigger_again: f128 = smaller_float;
64256425 if (bigger_again == float_number) {
64266426 const result = try gz.addFloat(smaller_float, node);
6427 return rvalue(gz, scope, rl, result, node);
6427 return rvalue(gz, rl, result, node);
64286428 }
64296429 // We need to use 128 bits. Break the float into 4 u32 values so we can
64306430 // put it into the `extra` array.
......@@ -6435,7 +6435,7 @@ fn floatLiteral(
64356435 .piece2 = @truncate(u32, int_bits >> 64),
64366436 .piece3 = @truncate(u32, int_bits >> 96),
64376437 });
6438 return rvalue(gz, scope, rl, result, node);
6438 return rvalue(gz, rl, result, node);
64396439}
64406440
64416441fn asmExpr(
......@@ -6578,7 +6578,7 @@ fn asmExpr(
65786578 .inputs = inputs,
65796579 .clobbers = clobbers_buffer[0..clobber_i],
65806580 });
6581 return rvalue(gz, scope, rl, result, node);
6581 return rvalue(gz, rl, result, node);
65826582}
65836583
65846584fn as(
......@@ -6593,7 +6593,7 @@ fn as(
65936593 switch (rl) {
65946594 .none, .none_or_ref, .discard, .ref, .ty => {
65956595 const result = try expr(gz, scope, .{ .ty = dest_type }, rhs);
6596 return rvalue(gz, scope, rl, result, node);
6596 return rvalue(gz, rl, result, node);
65976597 },
65986598 .ptr, .inferred_ptr => |result_ptr| {
65996599 return asRlPtr(gz, scope, rl, result_ptr, rhs, dest_type);
......@@ -6620,13 +6620,13 @@ fn unionInit(
66206620 .field_name = field_name,
66216621 });
66226622 const result = try expr(gz, scope, .{ .ty = union_type }, params[2]);
6623 return rvalue(gz, scope, rl, result, node);
6623 return rvalue(gz, rl, result, node);
66246624 },
66256625 .ptr => |result_ptr| {
6626 return unionInitRlPtr(gz, scope, rl, node, result_ptr, params[2], union_type, field_name);
6626 return unionInitRlPtr(gz, scope, node, result_ptr, params[2], union_type, field_name);
66276627 },
66286628 .block_ptr => |block_scope| {
6629 return unionInitRlPtr(gz, scope, rl, node, block_scope.rl_ptr, params[2], union_type, field_name);
6629 return unionInitRlPtr(gz, scope, node, block_scope.rl_ptr, params[2], union_type, field_name);
66306630 },
66316631 }
66326632}
......@@ -6634,14 +6634,12 @@ fn unionInit(
66346634fn unionInitRlPtr(
66356635 parent_gz: *GenZir,
66366636 scope: *Scope,
6637 rl: ResultLoc,
66386637 node: ast.Node.Index,
66396638 result_ptr: Zir.Inst.Ref,
66406639 expr_node: ast.Node.Index,
66416640 union_type: Zir.Inst.Ref,
66426641 field_name: Zir.Inst.Ref,
66436642) InnerError!Zir.Inst.Ref {
6644 _ = rl;
66456643 const union_init_ptr = try parent_gz.addPlNode(.union_init_ptr, node, Zir.Inst.UnionInitPtr{
66466644 .result_ptr = result_ptr,
66476645 .union_type = union_type,
......@@ -6683,7 +6681,7 @@ fn asRlPtr(
66836681 parent_zir.appendAssumeCapacity(src_inst);
66846682 }
66856683 const casted_result = try parent_gz.addBin(.as, dest_type, result);
6686 return rvalue(parent_gz, scope, rl, casted_result, operand_node);
6684 return rvalue(parent_gz, rl, casted_result, operand_node);
66876685 } else {
66886686 try parent_zir.appendSlice(astgen.gpa, as_scope.instructions.items);
66896687 return result;
......@@ -6707,16 +6705,16 @@ fn bitCast(
67076705 .lhs = dest_type,
67086706 .rhs = operand,
67096707 });
6710 return rvalue(gz, scope, rl, result, node);
6708 return rvalue(gz, rl, result, node);
67116709 },
67126710 .ref => {
67136711 return astgen.failNode(node, "cannot take address of `@bitCast` result", .{});
67146712 },
67156713 .ptr, .inferred_ptr => |result_ptr| {
6716 return bitCastRlPtr(gz, scope, rl, node, dest_type, result_ptr, rhs);
6714 return bitCastRlPtr(gz, scope, node, dest_type, result_ptr, rhs);
67176715 },
67186716 .block_ptr => |block| {
6719 return bitCastRlPtr(gz, scope, rl, node, dest_type, block.rl_ptr, rhs);
6717 return bitCastRlPtr(gz, scope, node, dest_type, block.rl_ptr, rhs);
67206718 },
67216719 }
67226720}
......@@ -6724,14 +6722,11 @@ fn bitCast(
67246722fn bitCastRlPtr(
67256723 gz: *GenZir,
67266724 scope: *Scope,
6727 rl: ResultLoc,
67286725 node: ast.Node.Index,
67296726 dest_type: Zir.Inst.Ref,
67306727 result_ptr: Zir.Inst.Ref,
67316728 rhs: ast.Node.Index,
67326729) InnerError!Zir.Inst.Ref {
6733 _ = rl;
6734 _ = scope;
67356730 const casted_result_ptr = try gz.addPlNode(.bitcast_result_ptr, node, Zir.Inst.Bin{
67366731 .lhs = dest_type,
67376732 .rhs = result_ptr,
......@@ -6751,7 +6746,7 @@ fn typeOf(
67516746 }
67526747 if (params.len == 1) {
67536748 const result = try gz.addUnNode(.typeof, try expr(gz, scope, .none, params[0]), node);
6754 return rvalue(gz, scope, rl, result, node);
6749 return rvalue(gz, rl, result, node);
67556750 }
67566751 const arena = gz.astgen.arena;
67576752 var items = try arena.alloc(Zir.Inst.Ref, params.len);
......@@ -6760,7 +6755,7 @@ fn typeOf(
67606755 }
67616756
67626757 const result = try gz.addExtendedMultiOp(.typeof_peer, node, items);
6763 return rvalue(gz, scope, rl, result, node);
6758 return rvalue(gz, rl, result, node);
67646759}
67656760
67666761fn builtinCall(
......@@ -6810,7 +6805,7 @@ fn builtinCall(
68106805 const str = try astgen.strLitAsString(str_lit_token);
68116806 try astgen.imports.put(astgen.gpa, str.index, {});
68126807 const result = try gz.addStrTok(.import, str.index, str_lit_token);
6813 return rvalue(gz, scope, rl, result, node);
6808 return rvalue(gz, rl, result, node);
68146809 },
68156810 .compile_log => {
68166811 const arg_refs = try astgen.gpa.alloc(Zir.Inst.Ref, params.len);
......@@ -6819,7 +6814,7 @@ fn builtinCall(
68196814 for (params) |param, i| arg_refs[i] = try expr(gz, scope, .none, param);
68206815
68216816 const result = try gz.addExtendedMultiOp(.compile_log, node, arg_refs);
6822 return rvalue(gz, scope, rl, result, node);
6817 return rvalue(gz, rl, result, node);
68236818 },
68246819 .field => {
68256820 const field_name = try comptimeExpr(gz, scope, .{ .ty = .const_slice_u8_type }, params[1]);
......@@ -6833,7 +6828,7 @@ fn builtinCall(
68336828 .lhs = try expr(gz, scope, .none, params[0]),
68346829 .field_name = field_name,
68356830 });
6836 return rvalue(gz, scope, rl, result, node);
6831 return rvalue(gz, rl, result, node);
68376832 },
68386833 .as => return as( gz, scope, rl, node, params[0], params[1]),
68396834 .bit_cast => return bitCast( gz, scope, rl, node, params[0], params[1]),
......@@ -6896,7 +6891,7 @@ fn builtinCall(
68966891 .decl_name = decl_name,
68976892 .options = options,
68986893 });
6899 return rvalue(gz, scope, rl, .void_value, node);
6894 return rvalue(gz, rl, .void_value, node);
69006895 },
69016896 .@"extern" => {
69026897 const type_inst = try typeExpr(gz, scope, params[0]);
......@@ -6906,18 +6901,18 @@ fn builtinCall(
69066901 .lhs = type_inst,
69076902 .rhs = options,
69086903 });
6909 return rvalue(gz, scope, rl, result, node);
6904 return rvalue(gz, rl, result, node);
69106905 },
69116906
69126907 .breakpoint => return simpleNoOpVoid(gz, scope, rl, node, .breakpoint),
69136908 .fence => return simpleNoOpVoid(gz, scope, rl, node, .fence),
69146909
6915 .This => return rvalue(gz, scope, rl, try gz.addNodeExtended(.this, node), node),
6916 .return_address => return rvalue(gz, scope, rl, try gz.addNodeExtended(.ret_addr, node), node),
6917 .src => return rvalue(gz, scope, rl, try gz.addNodeExtended(.builtin_src, node), node),
6918 .error_return_trace => return rvalue(gz, scope, rl, try gz.addNodeExtended(.error_return_trace, node), node),
6919 .frame => return rvalue(gz, scope, rl, try gz.addNodeExtended(.frame, node), node),
6920 .frame_address => return rvalue(gz, scope, rl, try gz.addNodeExtended(.frame_address, node), node),
6910 .This => return rvalue(gz, rl, try gz.addNodeExtended(.this, node), node),
6911 .return_address => return rvalue(gz, rl, try gz.addNodeExtended(.ret_addr, node), node),
6912 .src => return rvalue(gz, rl, try gz.addNodeExtended(.builtin_src, node), node),
6913 .error_return_trace => return rvalue(gz, rl, try gz.addNodeExtended(.error_return_trace, node), node),
6914 .frame => return rvalue(gz, rl, try gz.addNodeExtended(.frame, node), node),
6915 .frame_address => return rvalue(gz, rl, try gz.addNodeExtended(.frame_address, node), node),
69216916
69226917 .type_info => return simpleUnOpType(gz, scope, rl, node, params[0], .type_info),
69236918 .size_of => return simpleUnOpType(gz, scope, rl, node, params[0], .size_of),
......@@ -6973,7 +6968,7 @@ fn builtinCall(
69736968 .lhs = dest_align,
69746969 .rhs = rhs,
69756970 });
6976 return rvalue(gz, scope, rl, result, node);
6971 return rvalue(gz, rl, result, node);
69776972 },
69786973
69796974 .has_decl => return hasDeclOrField(gz, scope, rl, node, params[0], params[1], .has_decl),
......@@ -7009,7 +7004,7 @@ fn builtinCall(
70097004 .node = gz.nodeIndexToRelative(node),
70107005 .operand = operand,
70117006 });
7012 return rvalue(gz, scope, rl, result, node);
7007 return rvalue(gz, rl, result, node);
70137008 },
70147009 .wasm_memory_grow => {
70157010 const index_arg = try expr(gz, scope, .{ .ty = .u32_type }, params[0]);
......@@ -7019,7 +7014,7 @@ fn builtinCall(
70197014 .lhs = index_arg,
70207015 .rhs = delta_arg,
70217016 });
7022 return rvalue(gz, scope, rl, result, node);
7017 return rvalue(gz, rl, result, node);
70237018 },
70247019 .c_define => {
70257020 const name = try comptimeExpr(gz, scope, .{ .ty = .const_slice_u8_type }, params[0]);
......@@ -7029,7 +7024,7 @@ fn builtinCall(
70297024 .lhs = name,
70307025 .rhs = value,
70317026 });
7032 return rvalue(gz, scope, rl, result, node);
7027 return rvalue(gz, rl, result, node);
70337028 },
70347029
70357030 .splat => {
......@@ -7039,7 +7034,7 @@ fn builtinCall(
70397034 .lhs = len,
70407035 .rhs = scalar,
70417036 });
7042 return rvalue(gz, scope, rl, result, node);
7037 return rvalue(gz, rl, result, node);
70437038 },
70447039 .reduce => {
70457040 const op = try expr(gz, scope, .{ .ty = .reduce_op_type }, params[0]);
......@@ -7048,7 +7043,7 @@ fn builtinCall(
70487043 .lhs = op,
70497044 .rhs = scalar,
70507045 });
7051 return rvalue(gz, scope, rl, result, node);
7046 return rvalue(gz, rl, result, node);
70527047 },
70537048
70547049 .add_with_overflow => return overflowArithmetic(gz, scope, rl, node, params, .add_with_overflow),
......@@ -7075,7 +7070,7 @@ fn builtinCall(
70757070 .rhs = rhs,
70767071 .ptr = ptr,
70777072 });
7078 return rvalue(gz, scope, rl, result, node);
7073 return rvalue(gz, rl, result, node);
70797074 },
70807075
70817076 .atomic_load => {
......@@ -7095,7 +7090,7 @@ fn builtinCall(
70957090 .lhs = ptr,
70967091 .rhs = ordering,
70977092 });
7098 return rvalue(gz, scope, rl, result, node);
7093 return rvalue(gz, rl, result, node);
70997094 },
71007095 .atomic_rmw => {
71017096 const int_type = try typeExpr(gz, scope, params[0]);
......@@ -7118,7 +7113,7 @@ fn builtinCall(
71187113 .operand = operand,
71197114 .ordering = ordering,
71207115 });
7121 return rvalue(gz, scope, rl, result, node);
7116 return rvalue(gz, rl, result, node);
71227117 },
71237118 .atomic_store => {
71247119 const int_type = try typeExpr(gz, scope, params[0]);
......@@ -7139,7 +7134,7 @@ fn builtinCall(
71397134 .operand = operand,
71407135 .ordering = ordering,
71417136 });
7142 return rvalue(gz, scope, rl, result, node);
7137 return rvalue(gz, rl, result, node);
71437138 },
71447139 .mul_add => {
71457140 const float_type = try typeExpr(gz, scope, params[0]);
......@@ -7151,7 +7146,7 @@ fn builtinCall(
71517146 .mulend2 = mulend2,
71527147 .addend = addend,
71537148 });
7154 return rvalue(gz, scope, rl, result, node);
7149 return rvalue(gz, rl, result, node);
71557150 },
71567151 .call => {
71577152 const options = try comptimeExpr(gz, scope, .{ .ty = .call_options_type }, params[0]);
......@@ -7162,7 +7157,7 @@ fn builtinCall(
71627157 .callee = callee,
71637158 .args = args,
71647159 });
7165 return rvalue(gz, scope, rl, result, node);
7160 return rvalue(gz, rl, result, node);
71667161 },
71677162 .field_parent_ptr => {
71687163 const parent_type = try typeExpr(gz, scope, params[0]);
......@@ -7173,7 +7168,7 @@ fn builtinCall(
71737168 .field_name = field_name,
71747169 .field_ptr = try expr(gz, scope, .{ .ty = field_ptr_type }, params[2]),
71757170 });
7176 return rvalue(gz, scope, rl, result, node);
7171 return rvalue(gz, rl, result, node);
71777172 },
71787173 .memcpy => {
71797174 const result = try gz.addPlNode(.memcpy, node, Zir.Inst.Memcpy{
......@@ -7181,7 +7176,7 @@ fn builtinCall(
71817176 .source = try expr(gz, scope, .{ .ty = .manyptr_const_u8_type }, params[1]),
71827177 .byte_count = try expr(gz, scope, .{ .ty = .usize_type }, params[2]),
71837178 });
7184 return rvalue(gz, scope, rl, result, node);
7179 return rvalue(gz, rl, result, node);
71857180 },
71867181 .memset => {
71877182 const result = try gz.addPlNode(.memset, node, Zir.Inst.Memset{
......@@ -7189,7 +7184,7 @@ fn builtinCall(
71897184 .byte = try expr(gz, scope, .{ .ty = .u8_type }, params[1]),
71907185 .byte_count = try expr(gz, scope, .{ .ty = .usize_type }, params[2]),
71917186 });
7192 return rvalue(gz, scope, rl, result, node);
7187 return rvalue(gz, rl, result, node);
71937188 },
71947189 .shuffle => {
71957190 const result = try gz.addPlNode(.shuffle, node, Zir.Inst.Shuffle{
......@@ -7198,7 +7193,7 @@ fn builtinCall(
71987193 .b = try expr(gz, scope, .none, params[2]),
71997194 .mask = try comptimeExpr(gz, scope, .none, params[3]),
72007195 });
7201 return rvalue(gz, scope, rl, result, node);
7196 return rvalue(gz, rl, result, node);
72027197 },
72037198 .async_call => {
72047199 const result = try gz.addPlNode(.builtin_async_call, node, Zir.Inst.AsyncCall{
......@@ -7207,14 +7202,14 @@ fn builtinCall(
72077202 .fn_ptr = try expr(gz, scope, .none, params[2]),
72087203 .args = try expr(gz, scope, .none, params[3]),
72097204 });
7210 return rvalue(gz, scope, rl, result, node);
7205 return rvalue(gz, rl, result, node);
72117206 },
72127207 .Vector => {
72137208 const result = try gz.addPlNode(.vector_type, node, Zir.Inst.Bin{
72147209 .lhs = try comptimeExpr(gz, scope, .{.ty = .u32_type}, params[0]),
72157210 .rhs = try typeExpr(gz, scope, params[1]),
72167211 });
7217 return rvalue(gz, scope, rl, result, node);
7212 return rvalue(gz, rl, result, node);
72187213 },
72197214
72207215 }
......@@ -7229,7 +7224,7 @@ fn simpleNoOpVoid(
72297224 tag: Zir.Inst.Tag,
72307225) InnerError!Zir.Inst.Ref {
72317226 _ = try gz.addNode(tag, node);
7232 return rvalue(gz, scope, rl, .void_value, node);
7227 return rvalue(gz, rl, .void_value, node);
72337228}
72347229
72357230fn hasDeclOrField(
......@@ -7247,7 +7242,7 @@ fn hasDeclOrField(
72477242 .lhs = container_type,
72487243 .rhs = name,
72497244 });
7250 return rvalue(gz, scope, rl, result, node);
7245 return rvalue(gz, rl, result, node);
72517246}
72527247
72537248fn typeCast(
......@@ -7263,7 +7258,7 @@ fn typeCast(
72637258 .lhs = try typeExpr(gz, scope, lhs_node),
72647259 .rhs = try expr(gz, scope, .none, rhs_node),
72657260 });
7266 return rvalue(gz, scope, rl, result, node);
7261 return rvalue(gz, rl, result, node);
72677262}
72687263
72697264fn simpleUnOpType(
......@@ -7276,7 +7271,7 @@ fn simpleUnOpType(
72767271) InnerError!Zir.Inst.Ref {
72777272 const operand = try typeExpr(gz, scope, operand_node);
72787273 const result = try gz.addUnNode(tag, operand, node);
7279 return rvalue(gz, scope, rl, result, node);
7274 return rvalue(gz, rl, result, node);
72807275}
72817276
72827277fn simpleUnOp(
......@@ -7290,7 +7285,7 @@ fn simpleUnOp(
72907285) InnerError!Zir.Inst.Ref {
72917286 const operand = try expr(gz, scope, operand_rl, operand_node);
72927287 const result = try gz.addUnNode(tag, operand, node);
7293 return rvalue(gz, scope, rl, result, node);
7288 return rvalue(gz, rl, result, node);
72947289}
72957290
72967291fn cmpxchg(
......@@ -7320,7 +7315,7 @@ fn cmpxchg(
73207315 .fail_order = try expr(gz, scope, .{ .ty = .atomic_ordering_type }, params[5]),
73217316 // zig fmt: on
73227317 });
7323 return rvalue(gz, scope, rl, result, node);
7318 return rvalue(gz, rl, result, node);
73247319}
73257320
73267321fn bitBuiltin(
......@@ -7335,7 +7330,7 @@ fn bitBuiltin(
73357330 const int_type = try typeExpr(gz, scope, int_type_node);
73367331 const operand = try expr(gz, scope, .{ .ty = int_type }, operand_node);
73377332 const result = try gz.addUnNode(tag, operand, node);
7338 return rvalue(gz, scope, rl, result, node);
7333 return rvalue(gz, rl, result, node);
73397334}
73407335
73417336fn divBuiltin(
......@@ -7351,7 +7346,7 @@ fn divBuiltin(
73517346 .lhs = try expr(gz, scope, .none, lhs_node),
73527347 .rhs = try expr(gz, scope, .none, rhs_node),
73537348 });
7354 return rvalue(gz, scope, rl, result, node);
7349 return rvalue(gz, rl, result, node);
73557350}
73567351
73577352fn simpleCBuiltin(
......@@ -7367,7 +7362,7 @@ fn simpleCBuiltin(
73677362 .node = gz.nodeIndexToRelative(node),
73687363 .operand = operand,
73697364 });
7370 return rvalue(gz, scope, rl, .void_value, node);
7365 return rvalue(gz, rl, .void_value, node);
73717366}
73727367
73737368fn offsetOf(
......@@ -7385,7 +7380,7 @@ fn offsetOf(
73857380 .lhs = type_inst,
73867381 .rhs = field_name,
73877382 });
7388 return rvalue(gz, scope, rl, result, node);
7383 return rvalue(gz, rl, result, node);
73897384}
73907385
73917386fn shiftOp(
......@@ -7404,7 +7399,7 @@ fn shiftOp(
74047399 .lhs = lhs,
74057400 .rhs = rhs,
74067401 });
7407 return rvalue(gz, scope, rl, result, node);
7402 return rvalue(gz, rl, result, node);
74087403}
74097404
74107405fn cImport(
......@@ -7429,7 +7424,7 @@ fn cImport(
74297424 try block_scope.setBlockBody(block_inst);
74307425 try gz.instructions.append(gpa, block_inst);
74317426
7432 return rvalue(gz, scope, rl, .void_value, node);
7427 return rvalue(gz, rl, .void_value, node);
74337428}
74347429
74357430fn overflowArithmetic(
......@@ -7459,7 +7454,7 @@ fn overflowArithmetic(
74597454 .rhs = rhs,
74607455 .ptr = ptr,
74617456 });
7462 return rvalue(gz, scope, rl, result, node);
7457 return rvalue(gz, rl, result, node);
74637458}
74647459
74657460fn callExpr(
......@@ -7511,7 +7506,7 @@ fn callExpr(
75117506 };
75127507 break :res try gz.addCall(tag, lhs, args, node);
75137508 };
7514 return rvalue(gz, scope, rl, result, node); // TODO function call with result location
7509 return rvalue(gz, rl, result, node); // TODO function call with result location
75157510}
75167511
75177512pub const simple_types = std.ComptimeStringMap(Zir.Inst.Ref, .{
......@@ -7987,12 +7982,10 @@ fn nodeMayEvalToError(tree: *const ast.Tree, start_node: ast.Node.Index) enum {
79877982/// If the `ResultLoc` is `ty`, it will coerce the result to the type.
79887983fn rvalue(
79897984 gz: *GenZir,
7990 scope: *Scope,
79917985 rl: ResultLoc,
79927986 result: Zir.Inst.Ref,
79937987 src_node: ast.Node.Index,
79947988) InnerError!Zir.Inst.Ref {
7995 _ = scope;
79967989 switch (rl) {
79977990 .none, .none_or_ref => return result,
79987991 .discard => {