aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-04-29 17:40:49 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-08 19:37:29 -0700
commitb7799ef322103c8e449c45494c29fb4a8c9867df (patch)
treef1f1a5fe4c52a7ce335a6e1ae75e939bcb07c86d /src/codegen
parent62381011e0dd692ec6bb30d14e0d5e2f6ec4d5d5 (diff)
downloadzig-b7799ef322103c8e449c45494c29fb4a8c9867df.tar.gz
zig-b7799ef322103c8e449c45494c29fb4a8c9867df.zip
std.Target.maxIntAlignment: move to compiler implementation
This should not be a public API, and the x86 backend does not support the value 16.
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/c/Type.zig10
-rw-r--r--src/codegen/llvm.zig2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/codegen/c/Type.zig b/src/codegen/c/Type.zig
index e6a9dc69a3..d38cd5d400 100644
--- a/src/codegen/c/Type.zig
+++ b/src/codegen/c/Type.zig
@@ -1312,10 +1312,10 @@ pub const Pool = struct {
},
else => {
const target = &mod.resolved_target.result;
- const abi_align = Type.intAbiAlignment(int_info.bits, target.*);
+ const abi_align = Type.intAbiAlignment(int_info.bits, target.*, false);
const abi_align_bytes = abi_align.toByteUnits().?;
const array_ctype = try pool.getArray(allocator, .{
- .len = @divExact(Type.intAbiSize(int_info.bits, target.*), abi_align_bytes),
+ .len = @divExact(Type.intAbiSize(int_info.bits, target.*, false), abi_align_bytes),
.elem_ctype = try pool.fromIntInfo(allocator, .{
.signedness = .unsigned,
.bits = @intCast(abi_align_bytes * 8),
@@ -1443,7 +1443,7 @@ pub const Pool = struct {
.name = .{ .index = .len },
.ctype = CType.usize,
.alignas = AlignAs.fromAbiAlignment(
- Type.intAbiAlignment(target.ptrBitWidth(), target.*),
+ Type.intAbiAlignment(target.ptrBitWidth(), target.*, false),
),
},
};
@@ -1545,7 +1545,7 @@ pub const Pool = struct {
.name = .{ .index = .len },
.ctype = CType.usize,
.alignas = AlignAs.fromAbiAlignment(
- Type.intAbiAlignment(target.ptrBitWidth(), target.*),
+ Type.intAbiAlignment(target.ptrBitWidth(), target.*, false),
),
},
};
@@ -1665,7 +1665,7 @@ pub const Pool = struct {
.name = .{ .index = .@"error" },
.ctype = error_set_ctype,
.alignas = AlignAs.fromAbiAlignment(
- Type.intAbiAlignment(error_set_bits, target.*),
+ Type.intAbiAlignment(error_set_bits, target.*, false),
),
},
.{
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 458c187fec..877b2365c8 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -609,7 +609,7 @@ const DataLayoutBuilder = struct {
switch (kind) {
.integer => {
if (self.target.ptrBitWidth() <= 16 and size >= 128) return;
- abi = @min(abi, self.target.maxIntAlignment() * 8);
+ abi = @min(abi, Type.maxIntAlignment(self.target, true) * 8);
switch (self.target.cpu.arch) {
.aarch64,
.aarch64_be,