mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
zir: remove unused zir as instruction
This commit is contained in:
parent
8c9efc95a1
commit
063d55c504
@ -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,
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user