authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-07-29 11:13:13+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-07-29 15:52:19+01:00
logd0bc5efba4979471f092a533c20ad04f9e730dec
tree78a249b8ae6056a7be84a7a8d7fadd54e2d5fead
parentb1dcf2b149c55cf8bc53cd9b9bdb707a0003e93f
signaturelock-open Commit is signed but in an unrecognized format.

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.

1 files changed, 0 insertions(+), 12 deletions(-)

src/Sema.zig-12
...@@ -5328,8 +5328,6 @@ fn zirStoreNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!v...@@ -5328,8 +5328,6 @@ fn zirStoreNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!v
5328 const tracy = trace(@src());5328 const tracy = trace(@src());
5329 defer tracy.end();5329 defer tracy.end();
53305330
5331 const pt = sema.pt;
5332 const zcu = pt.zcu;
5333 const zir_tags = sema.code.instructions.items(.tag);5331 const zir_tags = sema.code.instructions.items(.tag);
5334 const zir_datas = sema.code.instructions.items(.data);5332 const zir_datas = sema.code.instructions.items(.data);
5335 const inst_data = zir_datas[@intFromEnum(inst)].pl_node;5333 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...@@ -5343,16 +5341,6 @@ fn zirStoreNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!v
5343 else5341 else
5344 false;5342 false;
53455343
5346 // Check for the possibility of this pattern:
5347 // %a = ret_ptr
5348 // %b = store(%a, %c)
5349 // Where %c is an error union or error set. In such case we need to add
5350 // to the current function's inferred error set, if any.
5351 if (is_ret and sema.fn_ret_ty_ies != null) switch (sema.typeOf(operand).zigTypeTag(zcu)) {
5352 .error_union, .error_set => try sema.addToInferredErrorSet(operand),
5353 else => {},
5354 };
5355
5356 const ptr_src = block.src(.{ .node_offset_store_ptr = inst_data.src_node });5344 const ptr_src = block.src(.{ .node_offset_store_ptr = inst_data.src_node });
5357 const operand_src = block.src(.{ .node_offset_store_operand = inst_data.src_node });5345 const operand_src = block.src(.{ .node_offset_store_operand = inst_data.src_node });
5358 const air_tag: Air.Inst.Tag = if (is_ret)5346 const air_tag: Air.Inst.Tag = if (is_ret)