aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorMatthew Lugg <mlugg@mlugg.co.uk>2025-07-30 21:30:29 +0100
committerGitHub <noreply@github.com>2025-07-30 21:30:29 +0100
commit389ccf692a56411186e32b25e1a19442542c9f30 (patch)
tree81e0b838d7acbc1f684ff0abbcc3c932b78d415d /src/codegen
parent3d639481d9001df391744720b756b7f97dce2c01 (diff)
parentcbe6e5b7fece38623d5eab43b71a83d1b6c7f323 (diff)
downloadzig-389ccf692a56411186e32b25e1a19442542c9f30.tar.gz
zig-389ccf692a56411186e32b25e1a19442542c9f30.zip
Merge pull request #24278 from gooncreeper/atomic-fixes
atomic fixes and clarification
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 111fc6ec14..5e522c3d73 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -4339,9 +4339,11 @@ pub const Object = struct {
/// types to work around a LLVM deficiency when targeting ARM/AArch64.
fn getAtomicAbiType(o: *Object, pt: Zcu.PerThread, ty: Type, is_rmw_xchg: bool) Allocator.Error!Builder.Type {
const zcu = pt.zcu;
+ const ip = &zcu.intern_pool;
const int_ty = switch (ty.zigTypeTag(zcu)) {
.int => ty,
.@"enum" => ty.intTagType(zcu),
+ .@"struct" => Type.fromInterned(ip.loadStructType(ty.toIntern()).backingIntTypeUnordered(ip)),
.float => {
if (!is_rmw_xchg) return .none;
return o.builder.intType(@intCast(ty.abiSize(zcu) * 8));
@@ -11424,7 +11426,7 @@ pub const FuncGen = struct {
if (workaround_disable_truncate) {
// see https://github.com/llvm/llvm-project/issues/64222
- // disable the truncation codepath for larger that 32bits value - with this heuristic, the backend passes the test suite.
+ // disable the truncation codepath for larger than 32bits value - with this heuristic, the backend passes the test suite.
return try fg.wip.load(access_kind, payload_llvm_ty, payload_ptr, payload_alignment, "");
}