aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorJacob G-W <jacoblevgw@gmail.com>2021-06-19 21:10:22 -0400
committerAndrew Kelley <andrew@ziglang.org>2021-06-21 17:03:03 -0700
commit9fffffb07b081858db0c2102a0680aa166b48263 (patch)
tree36caed31c5b2aaa8e08bb8e6e90e9b2c30910ff3 /src/codegen/c.zig
parentb83b3883ba0b5e965f8f7f1298c77c6d766741af (diff)
downloadzig-9fffffb07b081858db0c2102a0680aa166b48263.tar.gz
zig-9fffffb07b081858db0c2102a0680aa166b48263.zip
fix code broken from previous commit
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 1100626553..ae439693b8 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -47,6 +47,8 @@ fn formatTypeAsCIdentifier(
options: std.fmt.FormatOptions,
writer: anytype,
) !void {
+ _ = fmt;
+ _ = options;
var buffer = [1]u8{0} ** 128;
// We don't care if it gets cut off, it's still more unique than a number
var buf = std.fmt.bufPrint(&buffer, "{}", .{data}) catch &buffer;
@@ -63,6 +65,8 @@ fn formatIdent(
options: std.fmt.FormatOptions,
writer: anytype,
) !void {
+ _ = fmt;
+ _ = options;
for (ident) |c, i| {
switch (c) {
'a'...'z', 'A'...'Z', '_' => try writer.writeByte(c),
@@ -747,6 +751,7 @@ pub fn genBody(o: *Object, body: ir.Body) error{ AnalysisFail, OutOfMemory }!voi
}
fn genVarPtr(o: *Object, inst: *Inst.VarPtr) !CValue {
+ _ = o;
return CValue{ .decl_ref = inst.variable.owner_decl };
}
@@ -937,6 +942,8 @@ fn genCall(o: *Object, inst: *Inst.Call) !CValue {
}
fn genDbgStmt(o: *Object, inst: *Inst.DbgStmt) !CValue {
+ _ = o;
+ _ = inst;
// TODO emit #line directive here with line number and filename
return CValue.none;
}
@@ -1016,11 +1023,13 @@ fn genBitcast(o: *Object, inst: *Inst.UnOp) !CValue {
}
fn genBreakpoint(o: *Object, inst: *Inst.NoOp) !CValue {
+ _ = inst;
try o.writer().writeAll("zig_breakpoint();\n");
return CValue.none;
}
fn genUnreach(o: *Object, inst: *Inst.NoOp) !CValue {
+ _ = inst;
try o.writer().writeAll("zig_unreachable();\n");
return CValue.none;
}