diff options
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/llvm.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 623aa995d4..bd59cef569 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -6032,6 +6032,7 @@ pub const FuncGen = struct { const o = self.ng.object; const pt = o.pt; const zcu = pt.zcu; + const ip = &zcu.intern_pool; const scalar_ty = operand_ty.scalarType(zcu); const int_ty = switch (scalar_ty.zigTypeTag(zcu)) { .@"enum" => scalar_ty.intTagType(zcu), @@ -6110,6 +6111,12 @@ pub const FuncGen = struct { return phi.toValue(); }, .float => return self.buildFloatCmp(fast, op, operand_ty, .{ lhs, rhs }), + .@"struct" => blk: { + const struct_obj = ip.loadStructType(scalar_ty.toIntern()); + assert(struct_obj.layout == .@"packed"); + const backing_index = struct_obj.backingIntTypeUnordered(ip); + break :blk Type.fromInterned(backing_index); + }, else => unreachable, }; const is_signed = int_ty.isSignedInt(zcu); |
