authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-12 19:38:08-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-13 02:04:20-07:00
logbec70a1a39398a3f4e2b1edf914c4755a9ebb623
treede061fcc0fa035b79588e8e854a93100902de4d1
parentf8a9bc57ce1a2a5a1b90e9a33501b64f2dd79019

stage2: remove pointless discards from source code

Good riddance!

9 files changed, 0 insertions(+), 24 deletions(-)

src/Autodoc.zig-4
......@@ -2506,7 +2506,6 @@ fn walkInstruction(
25062506 try self.srcLocInfo(file, sn, parent_src)
25072507 else
25082508 parent_src;
2509 _ = src_info;
25102509
25112510 const decls_len = if (small.has_decls_len) blk: {
25122511 const decls_len = file.zir.extra[extra_index];
......@@ -2627,7 +2626,6 @@ fn walkInstruction(
26272626 extra_index += 1;
26282627 break :blk fields_len;
26292628 } else 0;
2630 _ = fields_len;
26312629
26322630 const decls_len = if (small.has_decls_len) blk: {
26332631 const decls_len = file.zir.extra[extra_index];
......@@ -2759,7 +2757,6 @@ fn walkInstruction(
27592757 extra_index += 1;
27602758 break :blk fields_len;
27612759 } else 0;
2762 _ = fields_len;
27632760
27642761 const decls_len = if (small.has_decls_len) blk: {
27652762 const decls_len = file.zir.extra[extra_index];
......@@ -2901,7 +2898,6 @@ fn walkInstruction(
29012898 extra_index += 1;
29022899 break :blk fields_len;
29032900 } else 0;
2904 _ = fields_len;
29052901
29062902 const decls_len = if (small.has_decls_len) blk: {
29072903 const decls_len = file.zir.extra[extra_index];
src/Sema.zig-4
......@@ -19670,8 +19670,6 @@ fn zirMemcpy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void
1967019670 if (try sema.resolveDefinedValue(block, src_src, src_ptr)) |src_ptr_val| {
1967119671 if (!src_ptr_val.isComptimeMutablePtr()) break :rs src_src;
1967219672 if (try sema.resolveDefinedValue(block, len_src, len)) |len_val| {
19673 _ = dest_ptr_val;
19674 _ = src_ptr_val;
1967519673 _ = len_val;
1967619674 return sema.fail(block, src, "TODO: Sema.zirMemcpy at comptime", .{});
1967719675 } else break :rs len_src;
......@@ -19713,7 +19711,6 @@ fn zirMemset(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void
1971319711 if (!ptr_val.isComptimeMutablePtr()) break :rs dest_src;
1971419712 if (try sema.resolveDefinedValue(block, len_src, len)) |len_val| {
1971519713 if (try sema.resolveMaybeUndefVal(block, value_src, value)) |val| {
19716 _ = ptr_val;
1971719714 _ = len_val;
1971819715 _ = val;
1971919716 return sema.fail(block, src, "TODO: Sema.zirMemset at comptime", .{});
......@@ -19941,7 +19938,6 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
1994119938 if (val.tag() == .generic_poison) {
1994219939 break :blk FuncLinkSection{ .generic = {} };
1994319940 }
19944 _ = val;
1994519941 return sema.fail(block, section_src, "TODO implement linksection on functions", .{});
1994619942 } else if (extra.data.bits.has_section_ref) blk: {
1994719943 const section_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
src/arch/aarch64/CodeGen.zig-3
......@@ -2581,7 +2581,6 @@ fn airErrUnionPayloadPtrSet(self: *Self, inst: Air.Inst.Index) !void {
25812581}
25822582
25832583fn airErrReturnTrace(self: *Self, inst: Air.Inst.Index) !void {
2584 _ = inst;
25852584 const result: MCValue = if (self.liveness.isUnused(inst))
25862585 .dead
25872586 else
......@@ -3614,7 +3613,6 @@ fn airRetLoad(self: *Self, inst: Air.Inst.Index) !void {
36143613 const ptr = try self.resolveInst(un_op);
36153614 const ptr_ty = self.air.typeOf(un_op);
36163615 const ret_ty = self.fn_type.fnReturnType();
3617 _ = ret_ty;
36183616
36193617 switch (self.ret_mcv) {
36203618 .none => {},
......@@ -5099,7 +5097,6 @@ fn lowerDeclRef(self: *Self, tv: TypedValue, decl_index: Module.Decl.Index) Inne
50995097 } else {
51005098 return self.fail("TODO codegen non-ELF const Decl pointer", .{});
51015099 }
5102 _ = tv;
51035100}
51045101
51055102fn lowerUnnamedConst(self: *Self, tv: TypedValue) InnerError!MCValue {
src/arch/arm/CodeGen.zig-4
......@@ -2111,7 +2111,6 @@ fn airErrUnionPayloadPtrSet(self: *Self, inst: Air.Inst.Index) !void {
21112111}
21122112
21132113fn airErrReturnTrace(self: *Self, inst: Air.Inst.Index) !void {
2114 _ = inst;
21152114 const result: MCValue = if (self.liveness.isUnused(inst))
21162115 .dead
21172116 else
......@@ -3353,7 +3352,6 @@ fn divFloat(
33533352) InnerError!MCValue {
33543353 _ = lhs_bind;
33553354 _ = rhs_bind;
3356 _ = lhs_ty;
33573355 _ = rhs_ty;
33583356 _ = maybe_inst;
33593357
......@@ -3420,7 +3418,6 @@ fn divExact(
34203418) InnerError!MCValue {
34213419 _ = lhs_bind;
34223420 _ = rhs_bind;
3423 _ = lhs_ty;
34243421 _ = rhs_ty;
34253422 _ = maybe_inst;
34263423
......@@ -3506,7 +3503,6 @@ fn modulo(
35063503) InnerError!MCValue {
35073504 _ = lhs_bind;
35083505 _ = rhs_bind;
3509 _ = lhs_ty;
35103506 _ = rhs_ty;
35113507 _ = maybe_inst;
35123508
src/arch/riscv64/CodeGen.zig-3
......@@ -1316,7 +1316,6 @@ fn airErrUnionPayloadPtrSet(self: *Self, inst: Air.Inst.Index) !void {
13161316}
13171317
13181318fn airErrReturnTrace(self: *Self, inst: Air.Inst.Index) !void {
1319 _ = inst;
13201319 const result: MCValue = if (self.liveness.isUnused(inst))
13211320 .dead
13221321 else
......@@ -1598,7 +1597,6 @@ fn airStructFieldPtrIndex(self: *Self, inst: Air.Inst.Index, index: u8) !void {
15981597 return self.structFieldPtr(ty_op.operand, ty_op.ty, index);
15991598}
16001599fn structFieldPtr(self: *Self, operand: Air.Inst.Ref, ty: Air.Inst.Ref, index: u32) !void {
1601 _ = self;
16021600 _ = operand;
16031601 _ = ty;
16041602 _ = index;
......@@ -1615,7 +1613,6 @@ fn airStructFieldVal(self: *Self, inst: Air.Inst.Index) !void {
16151613}
16161614
16171615fn airFieldParentPtr(self: *Self, inst: Air.Inst.Index) !void {
1618 _ = self;
16191616 _ = inst;
16201617 return self.fail("TODO implement codegen airFieldParentPtr", .{});
16211618}
src/arch/sparc64/CodeGen.zig-2
......@@ -2084,9 +2084,7 @@ fn airStructFieldVal(self: *Self, inst: Air.Inst.Index) !void {
20842084}
20852085
20862086fn airSwitch(self: *Self, inst: Air.Inst.Index) !void {
2087 _ = self;
20882087 _ = inst;
2089
20902088 return self.fail("TODO implement switch for {}", .{self.target.cpu.arch});
20912089}
20922090
src/arch/x86_64/CodeGen.zig-2
......@@ -1960,7 +1960,6 @@ fn airErrUnionPayloadPtrSet(self: *Self, inst: Air.Inst.Index) !void {
19601960}
19611961
19621962fn airErrReturnTrace(self: *Self, inst: Air.Inst.Index) !void {
1963 _ = inst;
19641963 const result: MCValue = if (self.liveness.isUnused(inst))
19651964 .dead
19661965 else
......@@ -6590,7 +6589,6 @@ fn airFloatToInt(self: *Self, inst: Air.Inst.Index) !void {
65906589fn airCmpxchg(self: *Self, inst: Air.Inst.Index) !void {
65916590 const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
65926591 const extra = self.air.extraData(Air.Block, ty_pl.payload);
6593 _ = ty_pl;
65946592 _ = extra;
65956593 return self.fail("TODO implement x86 airCmpxchg", .{});
65966594 // return self.finishAir(inst, result, .{ extra.ptr, extra.expected_value, extra.new_value });
src/link/Plan9.zig-1
......@@ -622,7 +622,6 @@ pub fn updateDeclExports(
622622) !void {
623623 try self.seeDecl(decl_index);
624624 // we do all the things in flush
625 _ = self;
626625 _ = module;
627626 _ = exports;
628627}
src/print_air.zig-1
......@@ -324,7 +324,6 @@ const Writer = struct {
324324 fn writeNoOp(w: *Writer, s: anytype, inst: Air.Inst.Index) @TypeOf(s).Error!void {
325325 _ = w;
326326 _ = inst;
327 _ = s;
328327 // no-op, no argument to write
329328 }
330329