diff options
| author | dweiller <4678790+dweiller@users.noreply.github.com> | 2023-11-16 20:40:32 +1100 |
|---|---|---|
| committer | dweiller <4678790+dweiller@users.noreply.github.com> | 2024-01-09 14:42:11 +1100 |
| commit | 063d55c50479659b171f72ac2ba2d13197f12138 (patch) | |
| tree | 127219c0cd3dd1eecbab094175651d6012b07b6d /src | |
| parent | 8c9efc95a1892276fee910546a019bee37b3726d (diff) | |
| download | zig-063d55c50479659b171f72ac2ba2d13197f12138.tar.gz zig-063d55c50479659b171f72ac2ba2d13197f12138.zip | |
zir: remove unused zir as instruction
Diffstat (limited to 'src')
| -rw-r--r-- | src/AstGen.zig | 1 | ||||
| -rw-r--r-- | src/Sema.zig | 9 | ||||
| -rw-r--r-- | src/Zir.zig | 6 | ||||
| -rw-r--r-- | src/print_zir.zig | 1 |
4 files changed, 0 insertions, 17 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig index 3941f5a378..c4fd31d815 100644 --- a/src/AstGen.zig +++ b/src/AstGen.zig @@ -2556,7 +2556,6 @@ fn addEnsureResult(gz: *GenZir, maybe_unused_result: Zir.Inst.Ref, statement: As .vector_type, .indexable_ptr_len, .anyframe_type, - .as, .as_node, .as_shift_operand, .bit_and, diff --git a/src/Sema.zig b/src/Sema.zig index a4f6f4f7bb..8f637d8847 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -1018,7 +1018,6 @@ fn analyzeBodyInner( .array_type => try sema.zirArrayType(block, inst), .array_type_sentinel => try sema.zirArrayTypeSentinel(block, inst), .vector_type => try sema.zirVectorType(block, inst), - .as => try sema.zirAs(block, inst), .as_node => try sema.zirAsNode(block, inst), .as_shift_operand => try sema.zirAsShiftOperand(block, inst), .bit_and => try sema.zirBitwise(block, inst, .bit_and), @@ -9794,14 +9793,6 @@ fn zirParamAnytype( sema.inst_map.putAssumeCapacity(inst, .generic_poison); } -fn zirAs(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Inst.Ref { - const tracy = trace(@src()); - defer tracy.end(); - - const bin_inst = sema.code.instructions.items(.data)[@intFromEnum(inst)].bin; - return sema.analyzeAs(block, sema.src, bin_inst.lhs, bin_inst.rhs, false); -} - fn zirAsNode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Inst.Ref { const tracy = trace(@src()); defer tracy.end(); diff --git a/src/Zir.zig b/src/Zir.zig index 1ecd8ff484..6c7f9711c0 100644 --- a/src/Zir.zig +++ b/src/Zir.zig @@ -277,9 +277,6 @@ pub const Inst = struct { /// Create a `anyframe->T` type. /// Uses the `un_node` field. anyframe_type, - /// Type coercion. No source location attached. - /// Uses the `bin` field. - as, /// Type coercion to the function's return type. /// Uses the `pl_node` field. Payload is `As`. AST node could be many things. as_node, @@ -1083,7 +1080,6 @@ pub const Inst = struct { .vector_elem_type, .indexable_ptr_len, .anyframe_type, - .as, .as_node, .as_shift_operand, .bit_and, @@ -1396,7 +1392,6 @@ pub const Inst = struct { .vector_elem_type, .indexable_ptr_len, .anyframe_type, - .as, .as_node, .as_shift_operand, .bit_and, @@ -1629,7 +1624,6 @@ pub const Inst = struct { .vector_elem_type = .un_node, .indexable_ptr_len = .un_node, .anyframe_type = .un_node, - .as = .bin, .as_node = .pl_node, .as_shift_operand = .pl_node, .bit_and = .pl_node, diff --git a/src/print_zir.zig b/src/print_zir.zig index efa0775291..df11c19ac2 100644 --- a/src/print_zir.zig +++ b/src/print_zir.zig @@ -199,7 +199,6 @@ const Writer = struct { const tag = tags[@intFromEnum(inst)]; try stream.print("= {s}(", .{@tagName(tags[@intFromEnum(inst)])}); switch (tag) { - .as, .store, .store_to_inferred_ptr, => try self.writeBin(stream, inst), |
