Merge pull request #21614 from alexrp/target-avr-align

`std.Target`: Fix `cTypePreferredAlignment()` to always return 1 for avr.
This commit is contained in:
Alex Rønne Petersen 2024-10-07 01:56:42 +02:00 committed by GitHub
commit aa8f39e271
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2637,7 +2637,6 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 {
},
.msp430,
.avr,
=> 2,
.arc,
@ -2686,6 +2685,9 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 {
.wasm32,
.wasm64,
=> 16,
.avr,
=> unreachable, // Handled above.
}),
);
}
@ -2720,12 +2722,7 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 {
.longdouble => return 4,
else => {},
},
.avr => switch (c_type) {
.char, .int, .uint, .long, .ulong, .float, .longdouble => return 1,
.short, .ushort => return 2,
.double => return 4,
.longlong, .ulonglong => return 8,
},
.avr => return 1,
.x86 => switch (target.os.tag) {
.windows, .uefi => switch (c_type) {
.longdouble => switch (target.abi) {
@ -2761,7 +2758,6 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 {
.arc,
.arm,
.armeb,
.avr,
.thumb,
.thumbeb,
.amdgcn,
@ -2799,6 +2795,9 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 {
.wasm32,
.wasm64,
=> 16,
.avr,
=> unreachable, // Handled above.
}),
);
}