Merge pull request 'llvm: handle packed structs in C ABI integer promotion' (#31062) from alexrp/zig:packed-struct-cconv-fix into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31062
This commit is contained in:
Alex Rønne Petersen 2026-01-31 07:09:19 +01:00
commit da95409f31
3 changed files with 3 additions and 2 deletions

View file

@ -16796,6 +16796,7 @@ fn createFileMap(
.OVERFLOW => return error.Unseekable,
.BADF => return errnoBug(err), // Always a race condition.
.INVAL => return errnoBug(err), // Invalid parameters to mmap()
.OPNOTSUPP => return errnoBug(err), // Bad flags with MAP.SHARED_VALIDATE on Linux.
else => return posix.unexpectedErrno(err),
}
};

View file

@ -146,6 +146,7 @@ pub const MAP_TYPE = enum(u4) {
SHARED = 0x01,
PRIVATE = 0x02,
SHARED_VALIDATE = 0x03,
DROPPABLE = 0x08,
};
pub const MAP = switch (native_arch) {

View file

@ -12608,8 +12608,7 @@ fn ccAbiPromoteInt(cc: std.builtin.CallingConvention, zcu: *Zcu, ty: Type) ?std.
}
const int_info = switch (ty.zigTypeTag(zcu)) {
.bool => Type.u1.intInfo(zcu),
.int, .@"enum", .error_set => ty.intInfo(zcu),
else => return null,
else => if (ty.isAbiInt(zcu)) ty.intInfo(zcu) else return null,
};
return switch (target.os.tag) {
.driverkit, .ios, .maccatalyst, .macos, .watchos, .tvos, .visionos => switch (int_info.bits) {