diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-03-16 16:46:45 +0100 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2024-03-17 03:06:17 +0100 |
| commit | d10c52c194a093f58df40bc6122f24380f0cc097 (patch) | |
| tree | 98909ac98dabdf19d082ce94dddf11a54cc11926 /src/type.zig | |
| parent | f88a971e4ff211b78695609b4482fb886f30a1af (diff) | |
| download | zig-d10c52c194a093f58df40bc6122f24380f0cc097.tar.gz zig-d10c52c194a093f58df40bc6122f24380f0cc097.zip | |
AstGen: disallow alignment on function types
A pointer type already has an alignment, so this information does not
need to be duplicated on the function type. This already has precedence
with addrspace which is already disallowed on function types for this
reason. Also fixes `@TypeOf(&func)` to have the correct addrspace and
alignment.
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/type.zig b/src/type.zig index 664498e353..9ea16d6224 100644 --- a/src/type.zig +++ b/src/type.zig @@ -396,9 +396,6 @@ pub const Type = struct { try writer.writeAll("..."); } try writer.writeAll(") "); - if (fn_info.alignment.toByteUnitsOptional()) |a| { - try writer.print("align({d}) ", .{a}); - } if (fn_info.cc != .Unspecified) { try writer.writeAll("callconv(."); try writer.writeAll(@tagName(fn_info.cc)); @@ -949,12 +946,7 @@ pub const Type = struct { }, // represents machine code; not a pointer - .func_type => |func_type| return .{ - .scalar = if (func_type.alignment != .none) - func_type.alignment - else - target_util.defaultFunctionAlignment(target), - }, + .func_type => return .{ .scalar = target_util.defaultFunctionAlignment(target) }, .simple_type => |t| switch (t) { .bool, |
