Commit 063d55c504

dweiller <4678790+dweiller@users.noreply.github.com>
2023-11-16 10:40:32
zir: remove unused zir as instruction
1 parent 8c9efc9
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,
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),
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();
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,