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().
This commit is contained in:
Daniele Cocca 2022-03-13 00:39:10 +00:00
parent 2036af94e9
commit 87744a7ea9

View File

@ -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(", ");
}