From ef72b91ac2b96ba64a53b08a661e9ad83a828ee4 Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Tue, 15 Oct 2024 21:28:42 +0200 Subject: compiler: Remove uses of defaultFunctionAlignment() in the frontend. minFunctionAlignment() is something we can know ahead of time for any given target because it's a matter of ABI. However, defaultFunctionAlignment() is a matter of optimization and every backend can do it differently depending on any number of factors. For example, LLVM will base the choice on the CPU model in its aarch64 backend. So just don't use this value in the frontend. --- src/Type.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Type.zig') diff --git a/src/Type.zig b/src/Type.zig index c6feb9ddd4..582e997ac7 100644 --- a/src/Type.zig +++ b/src/Type.zig @@ -1020,7 +1020,7 @@ pub fn abiAlignmentInner( }, // represents machine code; not a pointer - .func_type => return .{ .scalar = target_util.defaultFunctionAlignment(target) }, + .func_type => return .{ .scalar = target_util.minFunctionAlignment(target) }, .simple_type => |t| switch (t) { .bool, -- cgit v1.2.3