| ... | @@ -3506,8 +3506,6 @@ fn zirSwitchCapture( | ... | @@ -3506,8 +3506,6 @@ fn zirSwitchCapture( |
| 3506 | is_multi: bool, | 3506 | is_multi: bool, |
| 3507 | is_ref: bool, | 3507 | is_ref: bool, |
| 3508 | ) InnerError!*Inst { | 3508 | ) InnerError!*Inst { |
| 3509 | _ = is_ref; | | |
| 3510 | _ = is_multi; | | |
| 3511 | const tracy = trace(@src()); | 3509 | const tracy = trace(@src()); |
| 3512 | defer tracy.end(); | 3510 | defer tracy.end(); |
| 3513 | | 3511 | |
| ... | @@ -3516,6 +3514,8 @@ fn zirSwitchCapture( | ... | @@ -3516,6 +3514,8 @@ fn zirSwitchCapture( |
| 3516 | const switch_info = zir_datas[capture_info.switch_inst].pl_node; | 3514 | const switch_info = zir_datas[capture_info.switch_inst].pl_node; |
| 3517 | const src = switch_info.src(); | 3515 | const src = switch_info.src(); |
| 3518 | | 3516 | |
| | 3517 | _ = is_ref; |
| | 3518 | _ = is_multi; |
| 3519 | return sema.mod.fail(&block.base, src, "TODO implement Sema for zirSwitchCapture", .{}); | 3519 | return sema.mod.fail(&block.base, src, "TODO implement Sema for zirSwitchCapture", .{}); |
| 3520 | } | 3520 | } |
| 3521 | | 3521 | |
| ... | @@ -3525,7 +3525,6 @@ fn zirSwitchCaptureElse( | ... | @@ -3525,7 +3525,6 @@ fn zirSwitchCaptureElse( |
| 3525 | inst: Zir.Inst.Index, | 3525 | inst: Zir.Inst.Index, |
| 3526 | is_ref: bool, | 3526 | is_ref: bool, |
| 3527 | ) InnerError!*Inst { | 3527 | ) InnerError!*Inst { |
| 3528 | _ = is_ref; | | |
| 3529 | const tracy = trace(@src()); | 3528 | const tracy = trace(@src()); |
| 3530 | defer tracy.end(); | 3529 | defer tracy.end(); |
| 3531 | | 3530 | |
| ... | @@ -3534,6 +3533,7 @@ fn zirSwitchCaptureElse( | ... | @@ -3534,6 +3533,7 @@ fn zirSwitchCaptureElse( |
| 3534 | const switch_info = zir_datas[capture_info.switch_inst].pl_node; | 3533 | const switch_info = zir_datas[capture_info.switch_inst].pl_node; |
| 3535 | const src = switch_info.src(); | 3534 | const src = switch_info.src(); |
| 3536 | | 3535 | |
| | 3536 | _ = is_ref; |
| 3537 | return sema.mod.fail(&block.base, src, "TODO implement Sema for zirSwitchCaptureElse", .{}); | 3537 | return sema.mod.fail(&block.base, src, "TODO implement Sema for zirSwitchCaptureElse", .{}); |
| 3538 | } | 3538 | } |
| 3539 | | 3539 | |
| ... | @@ -4528,17 +4528,19 @@ fn zirImport(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError! | ... | @@ -4528,17 +4528,19 @@ fn zirImport(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError! |
| 4528 | } | 4528 | } |
| 4529 | | 4529 | |
| 4530 | fn zirShl(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | 4530 | fn zirShl(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { |
| 4531 | _ = block; | | |
| 4532 | _ = inst; | | |
| 4533 | const tracy = trace(@src()); | 4531 | const tracy = trace(@src()); |
| 4534 | defer tracy.end(); | 4532 | defer tracy.end(); |
| | 4533 | |
| | 4534 | _ = block; |
| | 4535 | _ = inst; |
| 4535 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirShl", .{}); | 4536 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirShl", .{}); |
| 4536 | } | 4537 | } |
| 4537 | | 4538 | |
| 4538 | fn zirShr(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | 4539 | fn zirShr(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { |
| 4539 | _ = inst; | | |
| 4540 | const tracy = trace(@src()); | 4540 | const tracy = trace(@src()); |
| 4541 | defer tracy.end(); | 4541 | defer tracy.end(); |
| | 4542 | |
| | 4543 | _ = inst; |
| 4542 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirShr", .{}); | 4544 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirShr", .{}); |
| 4543 | } | 4545 | } |
| 4544 | | 4546 | |
| ... | @@ -4606,23 +4608,26 @@ fn zirBitwise( | ... | @@ -4606,23 +4608,26 @@ fn zirBitwise( |
| 4606 | } | 4608 | } |
| 4607 | | 4609 | |
| 4608 | fn zirBitNot(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | 4610 | fn zirBitNot(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { |
| 4609 | _ = inst; | | |
| 4610 | const tracy = trace(@src()); | 4611 | const tracy = trace(@src()); |
| 4611 | defer tracy.end(); | 4612 | defer tracy.end(); |
| | 4613 | |
| | 4614 | _ = inst; |
| 4612 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirBitNot", .{}); | 4615 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirBitNot", .{}); |
| 4613 | } | 4616 | } |
| 4614 | | 4617 | |
| 4615 | fn zirArrayCat(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | 4618 | fn zirArrayCat(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { |
| 4616 | _ = inst; | | |
| 4617 | const tracy = trace(@src()); | 4619 | const tracy = trace(@src()); |
| 4618 | defer tracy.end(); | 4620 | defer tracy.end(); |
| | 4621 | |
| | 4622 | _ = inst; |
| 4619 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirArrayCat", .{}); | 4623 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirArrayCat", .{}); |
| 4620 | } | 4624 | } |
| 4621 | | 4625 | |
| 4622 | fn zirArrayMul(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { | 4626 | fn zirArrayMul(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst { |
| 4623 | _ = inst; | | |
| 4624 | const tracy = trace(@src()); | 4627 | const tracy = trace(@src()); |
| 4625 | defer tracy.end(); | 4628 | defer tracy.end(); |
| | 4629 | |
| | 4630 | _ = inst; |
| 4626 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirArrayMul", .{}); | 4631 | return sema.mod.fail(&block.base, sema.src, "TODO implement zirArrayMul", .{}); |
| 4627 | } | 4632 | } |
| 4628 | | 4633 | |
| ... | @@ -5529,7 +5534,6 @@ fn zirUnionInitPtr(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) Inner | ... | @@ -5529,7 +5534,6 @@ fn zirUnionInitPtr(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) Inner |
| 5529 | } | 5534 | } |
| 5530 | | 5535 | |
| 5531 | fn zirStructInit(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: bool) InnerError!*Inst { | 5536 | fn zirStructInit(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: bool) InnerError!*Inst { |
| 5532 | _ = is_ref; | | |
| 5533 | const mod = sema.mod; | 5537 | const mod = sema.mod; |
| 5534 | const gpa = sema.gpa; | 5538 | const gpa = sema.gpa; |
| 5535 | const zir_datas = sema.code.instructions.items(.data); | 5539 | const zir_datas = sema.code.instructions.items(.data); |
| ... | @@ -5618,6 +5622,10 @@ fn zirStructInit(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: | ... | @@ -5618,6 +5622,10 @@ fn zirStructInit(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: |
| 5618 | return mod.failWithOwnedErrorMsg(&block.base, msg); | 5622 | return mod.failWithOwnedErrorMsg(&block.base, msg); |
| 5619 | } | 5623 | } |
| 5620 | | 5624 | |
| | 5625 | if (is_ref) { |
| | 5626 | return mod.fail(&block.base, src, "TODO: Sema.zirStructInit is_ref=true", .{}); |
| | 5627 | } |
| | 5628 | |
| 5621 | const is_comptime = for (field_inits) |field_init| { | 5629 | const is_comptime = for (field_inits) |field_init| { |
| 5622 | if (field_init.value() == null) { | 5630 | if (field_init.value() == null) { |
| 5623 | break false; | 5631 | break false; |
| ... | @@ -5639,23 +5647,26 @@ fn zirStructInit(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: | ... | @@ -5639,23 +5647,26 @@ fn zirStructInit(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: |
| 5639 | } | 5647 | } |
| 5640 | | 5648 | |
| 5641 | fn zirStructInitAnon(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: bool) InnerError!*Inst { | 5649 | fn zirStructInitAnon(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: bool) InnerError!*Inst { |
| 5642 | _ = is_ref; | | |
| 5643 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; | 5650 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; |
| 5644 | const src = inst_data.src(); | 5651 | const src = inst_data.src(); |
| | 5652 | |
| | 5653 | _ = is_ref; |
| 5645 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirStructInitAnon", .{}); | 5654 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirStructInitAnon", .{}); |
| 5646 | } | 5655 | } |
| 5647 | | 5656 | |
| 5648 | fn zirArrayInit(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: bool) InnerError!*Inst { | 5657 | fn zirArrayInit(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: bool) InnerError!*Inst { |
| 5649 | _ = is_ref; | | |
| 5650 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; | 5658 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; |
| 5651 | const src = inst_data.src(); | 5659 | const src = inst_data.src(); |
| | 5660 | |
| | 5661 | _ = is_ref; |
| 5652 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirArrayInit", .{}); | 5662 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirArrayInit", .{}); |
| 5653 | } | 5663 | } |
| 5654 | | 5664 | |
| 5655 | fn zirArrayInitAnon(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: bool) InnerError!*Inst { | 5665 | fn zirArrayInitAnon(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index, is_ref: bool) InnerError!*Inst { |
| 5656 | _ = is_ref; | | |
| 5657 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; | 5666 | const inst_data = sema.code.instructions.items(.data)[inst].pl_node; |
| 5658 | const src = inst_data.src(); | 5667 | const src = inst_data.src(); |
| | 5668 | |
| | 5669 | _ = is_ref; |
| 5659 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirArrayInitAnon", .{}); | 5670 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirArrayInitAnon", .{}); |
| 5660 | } | 5671 | } |
| 5661 | | 5672 | |
| ... | @@ -6050,9 +6061,10 @@ fn zirAwait( | ... | @@ -6050,9 +6061,10 @@ fn zirAwait( |
| 6050 | inst: Zir.Inst.Index, | 6061 | inst: Zir.Inst.Index, |
| 6051 | is_nosuspend: bool, | 6062 | is_nosuspend: bool, |
| 6052 | ) InnerError!*Inst { | 6063 | ) InnerError!*Inst { |
| 6053 | _ = is_nosuspend; | | |
| 6054 | const inst_data = sema.code.instructions.items(.data)[inst].un_node; | 6064 | const inst_data = sema.code.instructions.items(.data)[inst].un_node; |
| 6055 | const src = inst_data.src(); | 6065 | const src = inst_data.src(); |
| | 6066 | |
| | 6067 | _ = is_nosuspend; |
| 6056 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirAwait", .{}); | 6068 | return sema.mod.fail(&block.base, src, "TODO: Sema.zirAwait", .{}); |
| 6057 | } | 6069 | } |
| 6058 | | 6070 | |
| ... | @@ -6632,8 +6644,6 @@ fn elemPtrArray( | ... | @@ -6632,8 +6644,6 @@ fn elemPtrArray( |
| 6632 | elem_index: *Inst, | 6644 | elem_index: *Inst, |
| 6633 | elem_index_src: LazySrcLoc, | 6645 | elem_index_src: LazySrcLoc, |
| 6634 | ) InnerError!*Inst { | 6646 | ) InnerError!*Inst { |
| 6635 | _ = elem_index; | | |
| 6636 | _ = elem_index_src; | | |
| 6637 | if (array_ptr.value()) |array_ptr_val| { | 6647 | if (array_ptr.value()) |array_ptr_val| { |
| 6638 | if (elem_index.value()) |index_val| { | 6648 | if (elem_index.value()) |index_val| { |
| 6639 | // Both array pointer and index are compile-time known. | 6649 | // Both array pointer and index are compile-time known. |
| ... | @@ -6649,6 +6659,8 @@ fn elemPtrArray( | ... | @@ -6649,6 +6659,8 @@ fn elemPtrArray( |
| 6649 | }); | 6659 | }); |
| 6650 | } | 6660 | } |
| 6651 | } | 6661 | } |
| | 6662 | _ = elem_index; |
| | 6663 | _ = elem_index_src; |
| 6652 | return sema.mod.fail(&block.base, src, "TODO implement more analyze elemptr for arrays", .{}); | 6664 | return sema.mod.fail(&block.base, src, "TODO implement more analyze elemptr for arrays", .{}); |
| 6653 | } | 6665 | } |
| 6654 | | 6666 | |
| ... | @@ -7508,14 +7520,14 @@ fn resolveTypeFields(sema: *Sema, block: *Scope.Block, src: LazySrcLoc, ty: Type | ... | @@ -7508,14 +7520,14 @@ fn resolveTypeFields(sema: *Sema, block: *Scope.Block, src: LazySrcLoc, ty: Type |
| 7508 | struct_obj.status = .have_field_types; | 7520 | struct_obj.status = .have_field_types; |
| 7509 | return ty; | 7521 | return ty; |
| 7510 | }, | 7522 | }, |
| 7511 | .extern_options => return sema.resolveBuiltinTypeFields(block, src, ty, "ExternOptions"), | 7523 | .extern_options => return sema.resolveBuiltinTypeFields(block, src, "ExternOptions"), |
| 7512 | .export_options => return sema.resolveBuiltinTypeFields(block, src, ty, "ExportOptions"), | 7524 | .export_options => return sema.resolveBuiltinTypeFields(block, src, "ExportOptions"), |
| 7513 | .atomic_ordering => return sema.resolveBuiltinTypeFields(block, src, ty, "AtomicOrdering"), | 7525 | .atomic_ordering => return sema.resolveBuiltinTypeFields(block, src, "AtomicOrdering"), |
| 7514 | .atomic_rmw_op => return sema.resolveBuiltinTypeFields(block, src, ty, "AtomicRmwOp"), | 7526 | .atomic_rmw_op => return sema.resolveBuiltinTypeFields(block, src, "AtomicRmwOp"), |
| 7515 | .calling_convention => return sema.resolveBuiltinTypeFields(block, src, ty, "CallingConvention"), | 7527 | .calling_convention => return sema.resolveBuiltinTypeFields(block, src, "CallingConvention"), |
| 7516 | .float_mode => return sema.resolveBuiltinTypeFields(block, src, ty, "FloatMode"), | 7528 | .float_mode => return sema.resolveBuiltinTypeFields(block, src, "FloatMode"), |
| 7517 | .reduce_op => return sema.resolveBuiltinTypeFields(block, src, ty, "ReduceOp"), | 7529 | .reduce_op => return sema.resolveBuiltinTypeFields(block, src, "ReduceOp"), |
| 7518 | .call_options => return sema.resolveBuiltinTypeFields(block, src, ty, "CallOptions"), | 7530 | .call_options => return sema.resolveBuiltinTypeFields(block, src, "CallOptions"), |
| 7519 | | 7531 | |
| 7520 | .@"union", .union_tagged => { | 7532 | .@"union", .union_tagged => { |
| 7521 | const union_obj = ty.cast(Type.Payload.Union).?.data; | 7533 | const union_obj = ty.cast(Type.Payload.Union).?.data; |
| ... | @@ -7541,11 +7553,8 @@ fn resolveBuiltinTypeFields( | ... | @@ -7541,11 +7553,8 @@ fn resolveBuiltinTypeFields( |
| 7541 | sema: *Sema, | 7553 | sema: *Sema, |
| 7542 | block: *Scope.Block, | 7554 | block: *Scope.Block, |
| 7543 | src: LazySrcLoc, | 7555 | src: LazySrcLoc, |
| 7544 | ty: Type, | | |
| 7545 | name: []const u8, | 7556 | name: []const u8, |
| 7546 | ) InnerError!Type { | 7557 | ) InnerError!Type { |
| 7547 | _ = ty; | | |
| 7548 | _ = name; | | |
| 7549 | const resolved_ty = try sema.getBuiltinType(block, src, name); | 7558 | const resolved_ty = try sema.getBuiltinType(block, src, name); |
| 7550 | return sema.resolveTypeFields(block, src, resolved_ty); | 7559 | return sema.resolveTypeFields(block, src, resolved_ty); |
| 7551 | } | 7560 | } |