aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/type.zig b/src/type.zig
index 43a3636ba3..632be95438 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -2195,7 +2195,12 @@ pub const Type = extern union {
.Slice => try writer.writeAll("[]"),
}
if (info.@"align" != 0 or info.host_size != 0 or info.vector_index != .none) {
- try writer.print("align({d}", .{info.@"align"});
+ if (info.@"align" != 0) {
+ try writer.print("align({d}", .{info.@"align"});
+ } else {
+ const alignment = info.pointee_type.abiAlignment(mod.getTarget());
+ try writer.print("align({d}", .{alignment});
+ }
if (info.bit_offset != 0 or info.host_size != 0) {
try writer.print(":{d}:{d}", .{ info.bit_offset, info.host_size });