diff options
| author | Daniele Cocca <daniele.cocca@gmail.com> | 2022-03-13 00:39:10 +0000 |
|---|---|---|
| committer | Daniele Cocca <daniele.cocca@gmail.com> | 2022-03-13 09:59:15 +0000 |
| commit | 87744a7ea9a2449764a110da4210d7750e3938ee (patch) | |
| tree | 0ef36de421b84b5a6c5eadafde0409d9c2a8b15b /src/codegen | |
| parent | 2036af94e97f0ac16293556423c144ec9e1b8226 (diff) | |
| download | zig-87744a7ea9a2449764a110da4210d7750e3938ee.tar.gz zig-87744a7ea9a2449764a110da4210d7750e3938ee.zip | |
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().
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/c.zig | 5 |
1 files changed, 4 insertions, 1 deletions
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(", "); } |
