| ... | ... | @@ -1296,19 +1296,21 @@ pub const CType = extern union { |
| 1296 | 1296 | |
| 1297 | 1297 | .Fn => { |
| 1298 | 1298 | const info = ty.fnInfo(); |
| 1299 | | if (lookup.isMutable()) { |
| 1300 | | const param_kind: Kind = switch (kind) { |
| 1301 | | .forward, .forward_parameter => .forward_parameter, |
| 1302 | | .complete, .parameter, .global => .parameter, |
| 1303 | | .payload => unreachable, |
| 1304 | | }; |
| 1305 | | _ = try lookup.typeToIndex(info.return_type, param_kind); |
| 1306 | | for (info.param_types) |param_type| { |
| 1307 | | if (!param_type.hasRuntimeBitsIgnoreComptime()) continue; |
| 1308 | | _ = try lookup.typeToIndex(param_type, param_kind); |
| 1299 | if (!info.is_generic) { |
| 1300 | if (lookup.isMutable()) { |
| 1301 | const param_kind: Kind = switch (kind) { |
| 1302 | .forward, .forward_parameter => .forward_parameter, |
| 1303 | .complete, .parameter, .global => .parameter, |
| 1304 | .payload => unreachable, |
| 1305 | }; |
| 1306 | _ = try lookup.typeToIndex(info.return_type, param_kind); |
| 1307 | for (info.param_types) |param_type| { |
| 1308 | if (!param_type.hasRuntimeBitsIgnoreComptime()) continue; |
| 1309 | _ = try lookup.typeToIndex(param_type, param_kind); |
| 1310 | } |
| 1309 | 1311 | } |
| 1310 | | } |
| 1311 | | self.init(if (info.is_var_args) .varargs_function else .function); |
| 1312 | self.init(if (info.is_var_args) .varargs_function else .function); |
| 1313 | } else self.init(.void); |
| 1312 | 1314 | }, |
| 1313 | 1315 | } |
| 1314 | 1316 | } |
| ... | ... | @@ -1619,6 +1621,7 @@ pub const CType = extern union { |
| 1619 | 1621 | .varargs_function, |
| 1620 | 1622 | => { |
| 1621 | 1623 | const info = ty.fnInfo(); |
| 1624 | assert(!info.is_generic); |
| 1622 | 1625 | const param_kind: Kind = switch (kind) { |
| 1623 | 1626 | .forward, .forward_parameter => .forward_parameter, |
| 1624 | 1627 | .complete, .parameter, .global => .parameter, |
| ... | ... | @@ -1764,6 +1767,7 @@ pub const CType = extern union { |
| 1764 | 1767 | if (ty.zigTypeTag() != .Fn) return false; |
| 1765 | 1768 | |
| 1766 | 1769 | const info = ty.fnInfo(); |
| 1770 | assert(!info.is_generic); |
| 1767 | 1771 | const data = cty.cast(Payload.Function).?.data; |
| 1768 | 1772 | const param_kind: Kind = switch (self.kind) { |
| 1769 | 1773 | .forward, .forward_parameter => .forward_parameter, |
| ... | ... | @@ -1878,6 +1882,7 @@ pub const CType = extern union { |
| 1878 | 1882 | .varargs_function, |
| 1879 | 1883 | => { |
| 1880 | 1884 | const info = ty.fnInfo(); |
| 1885 | assert(!info.is_generic); |
| 1881 | 1886 | const param_kind: Kind = switch (self.kind) { |
| 1882 | 1887 | .forward, .forward_parameter => .forward_parameter, |
| 1883 | 1888 | .complete, .parameter, .global => .parameter, |