aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorJacob G-W <jacoblevgw@gmail.com>2021-06-09 21:35:42 -0400
committerAndrew Kelley <andrew@ziglang.org>2021-06-21 17:03:03 -0700
commit641ecc260f43ffb2398acb80cbd141535dbbb03d (patch)
tree87455d3b460f517ad35bcda2b3a2e38599dd4aa1 /src/codegen
parentd34a1ccb0ea75ba31f374b8b2d34e18326b147b1 (diff)
downloadzig-641ecc260f43ffb2398acb80cbd141535dbbb03d.tar.gz
zig-641ecc260f43ffb2398acb80cbd141535dbbb03d.zip
std, src, doc, test: remove unused variables
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/c.zig1
-rw-r--r--src/codegen/spirv.zig4
-rw-r--r--src/codegen/wasm.zig3
3 files changed, 1 insertions, 7 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 7ebecb45c9..1100626553 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -1107,7 +1107,6 @@ fn genAsm(o: *Object, as: *Inst.Assembly) !CValue {
for (as.inputs) |i, index| {
if (i[0] == '{' and i[i.len - 1] == '}') {
const reg = i[1 .. i.len - 1];
- const arg = as.args[index];
if (index > 0) {
try writer.writeAll(", ");
}
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index 3bff09bd8d..9e0cd19f6f 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -714,7 +714,6 @@ pub const DeclGen = struct {
return self.fail(inst.base.src, "TODO: SPIR-V backend: binary operations for strange integers", .{});
}
- const is_bool = info.class == .bool;
const is_float = info.class == .float;
const is_signed = info.signedness == .signed;
// **Note**: All these operations must be valid for vectors as well!
@@ -802,8 +801,6 @@ pub const DeclGen = struct {
const result_id = self.spv.allocResultId();
const result_type_id = try self.genType(inst.base.src, inst.base.ty);
- const info = try self.arithmeticTypeInfo(inst.operand.ty);
-
const opcode = switch (inst.base.tag) {
// Bool -> bool
.not => Opcode.OpLogicalNot,
@@ -867,6 +864,7 @@ pub const DeclGen = struct {
// are not allowed to be created from a phi node, and throw an error for those. For now, genType already throws
// an error for pointers.
const result_type_id = try self.genType(inst.base.src, inst.base.ty);
+ _ = result_type_id;
try writeOpcode(&self.code, .OpPhi, 2 + @intCast(u16, incoming_blocks.items.len * 2)); // result type + result + variable/parent...
diff --git a/src/codegen/wasm.zig b/src/codegen/wasm.zig
index d7fe239d3b..a830ca36e0 100644
--- a/src/codegen/wasm.zig
+++ b/src/codegen/wasm.zig
@@ -849,7 +849,6 @@ pub const Context = struct {
}
fn genCall(self: *Context, inst: *Inst.Call) InnerError!WValue {
- const func_inst = inst.func.castTag(.constant).?;
const func_val = inst.func.value().?;
const target: *Decl = blk: {
@@ -1146,8 +1145,6 @@ pub const Context = struct {
}
fn genCmp(self: *Context, inst: *Inst.BinOp, op: std.math.CompareOperator) InnerError!WValue {
- const ty = inst.lhs.ty.tag();
-
// save offset, so potential conditions can insert blocks in front of
// the comparison that we can later jump back to
const offset = self.code.items.len;