From 87744a7ea9a2449764a110da4210d7750e3938ee Mon Sep 17 00:00:00 2001 From: Daniele Cocca Date: Sun, 13 Mar 2022 00:39:10 +0000 Subject: CBE: skip 0 bit integers from function signatures This was already done for void types, and needs to be done for 0 bit integer types as well to align the rendered function signatures with the effective size of extra.data.args_len as seen by airCall(). --- src/codegen/c.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/codegen/c.zig') diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 5ab84520a4..39b84dde3c 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -839,10 +839,13 @@ pub const DeclGen = struct { try w.writeAll("("); const param_len = dg.decl.ty.fnParamLen(); + const target = dg.module.getTarget(); var index: usize = 0; var params_written: usize = 0; while (index < param_len) : (index += 1) { - if (dg.decl.ty.fnParamType(index).zigTypeTag() == .Void) continue; + const param_type = dg.decl.ty.fnParamType(index); + if (param_type.zigTypeTag() == .Void) continue; + if (param_type.isInt() and param_type.intInfo(target).bits == 0) continue; if (params_written > 0) { try w.writeAll(", "); } -- cgit v1.2.3