diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-03-17 15:19:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-17 15:19:54 -0700 |
| commit | d981549d65849591749d8d9db12ddf2bf7361399 (patch) | |
| tree | ced0941ad568c7bb7cddc57759e8d320a71ab7fc /src/codegen | |
| parent | 294f51814f491ae4a09348d9e7221ae3e550c16f (diff) | |
| parent | edeed592eeed151780ae8a0b13c3d4d17c3f93b2 (diff) | |
| download | zig-d981549d65849591749d8d9db12ddf2bf7361399.tar.gz zig-d981549d65849591749d8d9db12ddf2bf7361399.zip | |
Merge pull request #19323 from jacobly0/rm-fn-type-align
AstGen: disallow alignment on function types
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/c.zig | 4 | ||||
| -rw-r--r-- | src/codegen/llvm.zig | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 8d630480e2..928cc995dc 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -1635,7 +1635,7 @@ pub const DeclGen = struct { switch (kind) { .forward => {}, - .complete => if (fn_info.alignment.toByteUnitsOptional()) |a| { + .complete => if (fn_decl.alignment.toByteUnitsOptional()) |a| { try w.print("{}zig_align_fn({})", .{ trailing, a }); trailing = .maybe_space; }, @@ -1666,7 +1666,7 @@ pub const DeclGen = struct { switch (kind) { .forward => { - if (fn_info.alignment.toByteUnitsOptional()) |a| { + if (fn_decl.alignment.toByteUnitsOptional()) |a| { try w.print(" zig_align_fn({})", .{a}); } switch (name) { diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 6273ce0942..d159a53175 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -2952,8 +2952,8 @@ pub const Object = struct { else => function_index.setCallConv(toLlvmCallConv(fn_info.cc, target), &o.builder), } - if (fn_info.alignment != .none) - function_index.setAlignment(fn_info.alignment.toLlvm(), &o.builder); + if (decl.alignment != .none) + function_index.setAlignment(decl.alignment.toLlvm(), &o.builder); // Function attributes that are independent of analysis results of the function body. try o.addCommonFnAttributes(&attributes, owner_mod); |
