diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-07-29 11:13:13 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-07-29 15:52:19 +0100 |
| commit | d0bc5efba4979471f092a533c20ad04f9e730dec (patch) | |
| tree | 78a249b8ae6056a7be84a7a8d7fadd54e2d5fead /src/Sema.zig | |
| parent | b1dcf2b149c55cf8bc53cd9b9bdb707a0003e93f (diff) | |
| download | zig-d0bc5efba4979471f092a533c20ad04f9e730dec.tar.gz zig-d0bc5efba4979471f092a533c20ad04f9e730dec.zip | |
Sema: remove dead logic
This is redundant because `storePtr2` will coerce to the return type
which (in `Sema.coerceInMemoryAllowedErrorSets`) will add errors to the
current function's IES if necessary.
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 8e0237bb9e..8200b2b234 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -5328,8 +5328,6 @@ fn zirStoreNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!v const tracy = trace(@src()); defer tracy.end(); - const pt = sema.pt; - const zcu = pt.zcu; const zir_tags = sema.code.instructions.items(.tag); const zir_datas = sema.code.instructions.items(.data); const inst_data = zir_datas[@intFromEnum(inst)].pl_node; @@ -5343,16 +5341,6 @@ fn zirStoreNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!v else false; - // Check for the possibility of this pattern: - // %a = ret_ptr - // %b = store(%a, %c) - // Where %c is an error union or error set. In such case we need to add - // to the current function's inferred error set, if any. - if (is_ret and sema.fn_ret_ty_ies != null) switch (sema.typeOf(operand).zigTypeTag(zcu)) { - .error_union, .error_set => try sema.addToInferredErrorSet(operand), - else => {}, - }; - const ptr_src = block.src(.{ .node_offset_store_ptr = inst_data.src_node }); const operand_src = block.src(.{ .node_offset_store_operand = inst_data.src_node }); const air_tag: Air.Inst.Tag = if (is_ret) |
