| ... | @@ -2147,9 +2147,11 @@ pub const Key = union(enum) { | ... | @@ -2147,9 +2147,11 @@ pub const Key = union(enum) { |
| 2147 | }; | 2147 | }; |
| 2148 | }; | 2148 | }; |
| 2149 | | 2149 | |
| 2150 | pub const SpirvType = struct { | 2150 | pub const SpirvType = extern struct { |
| 2151 | /// A `spirv_reify` instruction. | 2151 | /// A `spirv_reify` instruction. |
| 2152 | zir_index: TrackedInst.Index, | 2152 | zir_index: TrackedInst.Index, |
| | 2153 | /// Always 0. |
| | 2154 | padding: u32 = 0, |
| 2153 | /// A hash of this type's attributes generated by Sema. | 2155 | /// A hash of this type's attributes generated by Sema. |
| 2154 | type_hash: u64, | 2156 | type_hash: u64, |
| 2155 | }; | 2157 | }; |
| ... | @@ -2591,7 +2593,6 @@ pub const Key = union(enum) { | ... | @@ -2591,7 +2593,6 @@ pub const Key = union(enum) { |
| 2591 | const KeyTag = @typeInfo(Key).@"union".tag_type.?; | 2593 | const KeyTag = @typeInfo(Key).@"union".tag_type.?; |
| 2592 | const seed = @intFromEnum(@as(KeyTag, key)); | 2594 | const seed = @intFromEnum(@as(KeyTag, key)); |
| 2593 | return switch (key) { | 2595 | return switch (key) { |
| 2594 | // TODO: assert no padding in these types | | |
| 2595 | inline .ptr_type, | 2596 | inline .ptr_type, |
| 2596 | .array_type, | 2597 | .array_type, |
| 2597 | .vector_type, | 2598 | .vector_type, |
| ... | @@ -2608,7 +2609,11 @@ pub const Key = union(enum) { | ... | @@ -2608,7 +2609,11 @@ pub const Key = union(enum) { |
| 2608 | .enum_tag, | 2609 | .enum_tag, |
| 2609 | .inferred_error_set_type, | 2610 | .inferred_error_set_type, |
| 2610 | .un, | 2611 | .un, |
| 2611 | => |x| Hash.hash(seed, asBytes(&x)), | 2612 | => |x| { |
| | 2613 | _ = extern struct { is_extern: @TypeOf(x) }; |
| | 2614 | comptime assert(std.meta.hasUniqueRepresentation(@TypeOf(x))); |
| | 2615 | return Hash.hash(seed, asBytes(&x)); |
| | 2616 | }, |
| 2612 | | 2617 | |
| 2613 | .int_type => |x| Hash.hash(seed + @intFromEnum(x.signedness), asBytes(&x.bits)), | 2618 | .int_type => |x| Hash.hash(seed + @intFromEnum(x.signedness), asBytes(&x.bits)), |
| 2614 | | 2619 | |