aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2024-03-11 22:42:32 +0200
committerGitHub <noreply@github.com>2024-03-11 22:42:32 +0200
commit4f782d1e853accbe1c4bfab2617c3813d4b1e59f (patch)
tree0eb768171ecfb058fba72d199afc951af206f8fb /src/codegen
parentd0c06ca7127110a8afeb0ef524a197049892db21 (diff)
parent6067d39522f939c08dd3f3ea4fb5889ff0024e72 (diff)
downloadzig-4f782d1e853accbe1c4bfab2617c3813d4b1e59f.tar.gz
zig-4f782d1e853accbe1c4bfab2617c3813d4b1e59f.zip
Merge pull request #18994 from ExpidusOS/feat/container-layout-rename-fields
std.builtin: make enum fields lowercase
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/c.zig56
-rw-r--r--src/codegen/c/type.zig2
-rw-r--r--src/codegen/llvm.zig56
-rw-r--r--src/codegen/llvm/Builder.zig2
-rw-r--r--src/codegen/llvm/bitcode_writer.zig4
-rw-r--r--src/codegen/spirv.zig16
-rw-r--r--src/codegen/spirv/Section.zig4
7 files changed, 70 insertions, 70 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index abbf7501fc..8d630480e2 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -890,7 +890,7 @@ pub const DeclGen = struct {
return writer.writeAll(" }");
},
.Struct => switch (ty.containerLayout(mod)) {
- .Auto, .Extern => {
+ .auto, .@"extern" => {
if (!location.isInitializer()) {
try writer.writeByte('(');
try dg.renderType(writer, ty);
@@ -912,7 +912,7 @@ pub const DeclGen = struct {
return writer.writeByte('}');
},
- .Packed => return writer.print("{x}", .{try dg.fmtIntLiteral(ty, Value.undef, .Other)}),
+ .@"packed" => return writer.print("{x}", .{try dg.fmtIntLiteral(ty, Value.undef, .Other)}),
},
.Union => {
if (!location.isInitializer()) {
@@ -1379,7 +1379,7 @@ pub const DeclGen = struct {
.struct_type => {
const struct_type = ip.loadStructType(ty.toIntern());
switch (struct_type.layout) {
- .Auto, .Extern => {
+ .auto, .@"extern" => {
if (!location.isInitializer()) {
try writer.writeByte('(');
try dg.renderType(writer, ty);
@@ -1408,7 +1408,7 @@ pub const DeclGen = struct {
}
try writer.writeByte('}');
},
- .Packed => {
+ .@"packed" => {
const int_info = ty.intInfo(mod);
const bits = Type.smallestUnsignedBits(int_info.bits - 1);
@@ -1517,7 +1517,7 @@ pub const DeclGen = struct {
if (un.tag == .none) {
const backing_ty = try ty.unionBackingType(mod);
switch (union_obj.getLayout(ip)) {
- .Packed => {
+ .@"packed" => {
if (!location.isInitializer()) {
try writer.writeByte('(');
try dg.renderType(writer, backing_ty);
@@ -1525,7 +1525,7 @@ pub const DeclGen = struct {
}
try dg.renderValue(writer, backing_ty, Value.fromInterned(un.val), initializer_type);
},
- .Extern => {
+ .@"extern" => {
if (location == .StaticInitializer) {
return dg.fail("TODO: C backend: implement extern union backing type rendering in static initializers", .{});
}
@@ -1551,7 +1551,7 @@ pub const DeclGen = struct {
const field_index = mod.unionTagFieldIndex(union_obj, Value.fromInterned(un.tag)).?;
const field_ty = Type.fromInterned(union_obj.field_types.get(ip)[field_index]);
const field_name = union_obj.loadTagType(ip).names.get(ip)[field_index];
- if (union_obj.getLayout(ip) == .Packed) {
+ if (union_obj.getLayout(ip) == .@"packed") {
if (field_ty.hasRuntimeBits(mod)) {
if (field_ty.isPtrAtRuntime(mod)) {
try writer.writeByte('(');
@@ -1999,7 +1999,7 @@ pub const DeclGen = struct {
try fwd.writeAll(if (is_global) "zig_extern " else "static ");
const maybe_exports = dg.module.decl_exports.get(decl_index);
const export_weak_linkage = if (maybe_exports) |exports|
- exports.items[0].opts.linkage == .Weak
+ exports.items[0].opts.linkage == .weak
else
false;
if (variable.is_weak_linkage or export_weak_linkage) try fwd.writeAll("zig_weak_linkage ");
@@ -2689,7 +2689,7 @@ fn genExports(o: *Object) !void {
const is_variable_const = switch (ip.indexToKey(tv.val.toIntern())) {
.func => return for (exports.items[1..], 1..) |@"export", i| {
try fwd.writeAll("zig_extern ");
- if (@"export".opts.linkage == .Weak) try fwd.writeAll("zig_weak_linkage_fn ");
+ if (@"export".opts.linkage == .weak) try fwd.writeAll("zig_weak_linkage_fn ");
try o.dg.renderFunctionSignature(
fwd,
decl_index,
@@ -2707,7 +2707,7 @@ fn genExports(o: *Object) !void {
};
for (exports.items[1..]) |@"export"| {
try fwd.writeAll("zig_extern ");
- if (@"export".opts.linkage == .Weak) try fwd.writeAll("zig_weak_linkage ");
+ if (@"export".opts.linkage == .weak) try fwd.writeAll("zig_weak_linkage ");
const export_name = ip.stringToSlice(@"export".opts.name);
try o.dg.renderTypeAndName(
fwd,
@@ -2842,7 +2842,7 @@ pub fn genFunc(f: *Function) !void {
try fwd_decl_writer.writeAll(if (is_global) "zig_extern " else "static ");
if (mod.decl_exports.get(decl_index)) |exports|
- if (exports.items[0].opts.linkage == .Weak) try fwd_decl_writer.writeAll("zig_weak_linkage_fn ");
+ if (exports.items[0].opts.linkage == .weak) try fwd_decl_writer.writeAll("zig_weak_linkage_fn ");
try o.dg.renderFunctionSignature(fwd_decl_writer, decl_index, .forward, .{ .export_index = 0 });
try fwd_decl_writer.writeAll(";\n");
try genExports(o);
@@ -3278,10 +3278,10 @@ fn genBodyInner(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail,
.int_from_ptr => try airIntFromPtr(f, inst),
- .atomic_store_unordered => try airAtomicStore(f, inst, toMemoryOrder(.Unordered)),
- .atomic_store_monotonic => try airAtomicStore(f, inst, toMemoryOrder(.Monotonic)),
- .atomic_store_release => try airAtomicStore(f, inst, toMemoryOrder(.Release)),
- .atomic_store_seq_cst => try airAtomicStore(f, inst, toMemoryOrder(.SeqCst)),
+ .atomic_store_unordered => try airAtomicStore(f, inst, toMemoryOrder(.unordered)),
+ .atomic_store_monotonic => try airAtomicStore(f, inst, toMemoryOrder(.monotonic)),
+ .atomic_store_release => try airAtomicStore(f, inst, toMemoryOrder(.release)),
+ .atomic_store_seq_cst => try airAtomicStore(f, inst, toMemoryOrder(.seq_cst)),
.struct_field_ptr_index_0 => try airStructFieldPtrIndex(f, inst, 0),
.struct_field_ptr_index_1 => try airStructFieldPtrIndex(f, inst, 1),
@@ -5497,7 +5497,7 @@ fn fieldLocation(
.Union => {
const union_obj = mod.typeToUnion(container_ty).?;
return switch (union_obj.getLayout(ip)) {
- .Auto, .Extern => {
+ .auto, .@"extern" => {
const field_ty = Type.fromInterned(union_obj.field_types.get(ip)[field_index]);
if (!field_ty.hasRuntimeBitsIgnoreComptime(mod))
return if (container_ty.unionTagTypeSafety(mod) != null and
@@ -5511,7 +5511,7 @@ fn fieldLocation(
else
.{ .identifier = ip.stringToSlice(field_name) } };
},
- .Packed => .begin,
+ .@"packed" => .begin,
};
},
.Pointer => switch (container_ty.ptrSize(mod)) {
@@ -5671,11 +5671,11 @@ fn airStructFieldVal(f: *Function, inst: Air.Inst.Index) !CValue {
const field_name: CValue = switch (mod.intern_pool.indexToKey(struct_ty.ip_index)) {
.struct_type => switch (struct_ty.containerLayout(mod)) {
- .Auto, .Extern => if (struct_ty.isSimpleTuple(mod))
+ .auto, .@"extern" => if (struct_ty.isSimpleTuple(mod))
.{ .field = extra.field_index }
else
.{ .identifier = ip.stringToSlice(struct_ty.legacyStructFieldName(extra.field_index, mod)) },
- .Packed => {
+ .@"packed" => {
const struct_type = mod.typeToStruct(struct_ty).?;
const int_info = struct_ty.intInfo(mod);
@@ -5740,7 +5740,7 @@ fn airStructFieldVal(f: *Function, inst: Air.Inst.Index) !CValue {
.union_type => field_name: {
const union_obj = ip.loadUnionType(struct_ty.toIntern());
- if (union_obj.flagsPtr(ip).layout == .Packed) {
+ if (union_obj.flagsPtr(ip).layout == .@"packed") {
const operand_lval = if (struct_byval == .constant) blk: {
const operand_local = try f.allocLocal(inst, struct_ty);
try f.writeCValue(writer, operand_local, .Other);
@@ -7081,7 +7081,7 @@ fn airAggregateInit(f: *Function, inst: Air.Inst.Index) !CValue {
}
},
.Struct => switch (inst_ty.containerLayout(mod)) {
- .Auto, .Extern => for (resolved_elements, 0..) |element, field_index| {
+ .auto, .@"extern" => for (resolved_elements, 0..) |element, field_index| {
if (inst_ty.structFieldIsComptime(field_index, mod)) continue;
const field_ty = inst_ty.structFieldType(field_index, mod);
if (!field_ty.hasRuntimeBitsIgnoreComptime(mod)) continue;
@@ -7095,7 +7095,7 @@ fn airAggregateInit(f: *Function, inst: Air.Inst.Index) !CValue {
try f.writeCValue(writer, element, .Other);
try a.end(f, writer);
},
- .Packed => {
+ .@"packed" => {
try f.writeCValue(writer, local, .Other);
try writer.writeAll(" = ");
const int_info = inst_ty.intInfo(mod);
@@ -7181,7 +7181,7 @@ fn airUnionInit(f: *Function, inst: Air.Inst.Index) !CValue {
const writer = f.object.writer();
const local = try f.allocLocal(inst, union_ty);
- if (union_obj.getLayout(ip) == .Packed) {
+ if (union_obj.getLayout(ip) == .@"packed") {
try f.writeCValue(writer, local, .Other);
try writer.writeAll(" = ");
try f.writeCValue(writer, payload, .Initializer);
@@ -7482,11 +7482,11 @@ fn airCVaCopy(f: *Function, inst: Air.Inst.Index) !CValue {
fn toMemoryOrder(order: std.builtin.AtomicOrder) [:0]const u8 {
return switch (order) {
// Note: unordered is actually even less atomic than relaxed
- .Unordered, .Monotonic => "zig_memory_order_relaxed",
- .Acquire => "zig_memory_order_acquire",
- .Release => "zig_memory_order_release",
- .AcqRel => "zig_memory_order_acq_rel",
- .SeqCst => "zig_memory_order_seq_cst",
+ .unordered, .monotonic => "zig_memory_order_relaxed",
+ .acquire => "zig_memory_order_acquire",
+ .release => "zig_memory_order_release",
+ .acq_rel => "zig_memory_order_acq_rel",
+ .seq_cst => "zig_memory_order_seq_cst",
};
}
diff --git a/src/codegen/c/type.zig b/src/codegen/c/type.zig
index b85daddbda..66f92c930d 100644
--- a/src/codegen/c/type.zig
+++ b/src/codegen/c/type.zig
@@ -1495,7 +1495,7 @@ pub const CType = extern union {
}
},
- .Struct, .Union => |zig_ty_tag| if (ty.containerLayout(mod) == .Packed) {
+ .Struct, .Union => |zig_ty_tag| if (ty.containerLayout(mod) == .@"packed") {
if (mod.typeToPackedStruct(ty)) |packed_struct| {
try self.initType(Type.fromInterned(packed_struct.backingIntType(ip).*), kind, lookup);
} else {
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 8f69dbc7e9..2a5a187e0d 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -1278,7 +1278,7 @@ pub const Object = struct {
const reloc_mode: llvm.RelocMode = if (pic)
.PIC
- else if (self.module.comp.config.link_mode == .Dynamic)
+ else if (self.module.comp.config.link_mode == .dynamic)
llvm.RelocMode.DynamicNoPIC
else
.Static;
@@ -1873,10 +1873,10 @@ pub const Object = struct {
if (comp.config.dll_export_fns)
global_index.setDllStorageClass(.dllexport, &o.builder);
global_index.setLinkage(switch (exports[0].opts.linkage) {
- .Internal => unreachable,
- .Strong => .external,
- .Weak => .weak_odr,
- .LinkOnce => .linkonce_odr,
+ .internal => unreachable,
+ .strong => .external,
+ .weak => .weak_odr,
+ .link_once => .linkonce_odr,
}, &o.builder);
global_index.setVisibility(switch (exports[0].opts.visibility) {
.default => .default,
@@ -3327,7 +3327,7 @@ pub const Object = struct {
const struct_type = ip.loadStructType(t.toIntern());
- if (struct_type.layout == .Packed) {
+ if (struct_type.layout == .@"packed") {
const int_ty = try o.lowerType(Type.fromInterned(struct_type.backingIntType(ip).*));
try o.type_map.put(o.gpa, t.toIntern(), int_ty);
return int_ty;
@@ -3477,7 +3477,7 @@ pub const Object = struct {
const union_obj = ip.loadUnionType(t.toIntern());
const layout = mod.getUnionLayout(union_obj);
- if (union_obj.flagsPtr(ip).layout == .Packed) {
+ if (union_obj.flagsPtr(ip).layout == .@"packed") {
const int_ty = try o.builder.intType(@intCast(t.bitSize(mod)));
try o.type_map.put(o.gpa, t.toIntern(), int_ty);
return int_ty;
@@ -4038,7 +4038,7 @@ pub const Object = struct {
const struct_type = ip.loadStructType(ty.toIntern());
assert(struct_type.haveLayout(ip));
const struct_ty = try o.lowerType(ty);
- if (struct_type.layout == .Packed) {
+ if (struct_type.layout == .@"packed") {
comptime assert(Type.packed_struct_layout_version == 2);
var running_int = try o.builder.intConst(struct_ty, 0);
var running_bits: u16 = 0;
@@ -4154,7 +4154,7 @@ pub const Object = struct {
const payload = if (un.tag != .none) p: {
const field_index = mod.unionTagFieldIndex(union_obj, Value.fromInterned(un.tag)).?;
const field_ty = Type.fromInterned(union_obj.field_types.get(ip)[field_index]);
- if (container_layout == .Packed) {
+ if (container_layout == .@"packed") {
if (!field_ty.hasRuntimeBits(mod)) return o.builder.intConst(union_ty, 0);
const small_int_val = try o.builder.castConst(
if (field_ty.isPtrAtRuntime(mod)) .ptrtoint else .bitcast,
@@ -4190,7 +4190,7 @@ pub const Object = struct {
} else p: {
assert(layout.tag_size == 0);
const union_val = try o.lowerValue(un.val);
- if (container_layout == .Packed) {
+ if (container_layout == .@"packed") {
const bitcast_val = try o.builder.castConst(
.bitcast,
union_val,
@@ -4324,7 +4324,7 @@ pub const Object = struct {
const field_index: u32 = @intCast(field_ptr.index);
switch (parent_ty.zigTypeTag(mod)) {
.Union => {
- if (parent_ty.containerLayout(mod) == .Packed) {
+ if (parent_ty.containerLayout(mod) == .@"packed") {
return parent_ptr;
}
@@ -6531,7 +6531,7 @@ pub const FuncGen = struct {
assert(!isByRef(field_ty, mod));
switch (struct_ty.zigTypeTag(mod)) {
.Struct => switch (struct_ty.containerLayout(mod)) {
- .Packed => {
+ .@"packed" => {
const struct_type = mod.typeToStruct(struct_ty).?;
const bit_offset = mod.structPackedFieldBitOffset(struct_type, field_index);
const containing_int = struct_llvm_val;
@@ -6558,7 +6558,7 @@ pub const FuncGen = struct {
},
},
.Union => {
- assert(struct_ty.containerLayout(mod) == .Packed);
+ assert(struct_ty.containerLayout(mod) == .@"packed");
const containing_int = struct_llvm_val;
const elem_llvm_ty = try o.lowerType(field_ty);
if (field_ty.zigTypeTag(mod) == .Float or field_ty.zigTypeTag(mod) == .Vector) {
@@ -6581,7 +6581,7 @@ pub const FuncGen = struct {
switch (struct_ty.zigTypeTag(mod)) {
.Struct => {
const layout = struct_ty.containerLayout(mod);
- assert(layout != .Packed);
+ assert(layout != .@"packed");
const struct_llvm_ty = try o.lowerType(struct_ty);
const llvm_field_index = o.llvmFieldIndex(struct_ty, field_index).?;
const field_ptr =
@@ -9995,7 +9995,7 @@ pub const FuncGen = struct {
return running_int;
}
- assert(result_ty.containerLayout(mod) != .Packed);
+ assert(result_ty.containerLayout(mod) != .@"packed");
if (isByRef(result_ty, mod)) {
// TODO in debug builds init to undef so that the padding will be 0xaa
@@ -10080,7 +10080,7 @@ pub const FuncGen = struct {
const layout = union_ty.unionGetLayout(mod);
const union_obj = mod.typeToUnion(union_ty).?;
- if (union_obj.getLayout(ip) == .Packed) {
+ if (union_obj.getLayout(ip) == .@"packed") {
const big_bits = union_ty.bitSize(mod);
const int_llvm_ty = try o.builder.intType(@intCast(big_bits));
const field_ty = Type.fromInterned(union_obj.field_types.get(ip)[extra.field_index]);
@@ -10420,7 +10420,7 @@ pub const FuncGen = struct {
const struct_ty = struct_ptr_ty.childType(mod);
switch (struct_ty.zigTypeTag(mod)) {
.Struct => switch (struct_ty.containerLayout(mod)) {
- .Packed => {
+ .@"packed" => {
const result_ty = self.typeOfIndex(inst);
const result_ty_info = result_ty.ptrInfo(mod);
const struct_ptr_ty_info = struct_ptr_ty.ptrInfo(mod);
@@ -10462,7 +10462,7 @@ pub const FuncGen = struct {
},
.Union => {
const layout = struct_ty.unionGetLayout(mod);
- if (layout.payload_size == 0 or struct_ty.containerLayout(mod) == .Packed) return struct_ptr;
+ if (layout.payload_size == 0 or struct_ty.containerLayout(mod) == .@"packed") return struct_ptr;
const payload_index = @intFromBool(layout.tag_align.compare(.gte, layout.payload_align));
const union_llvm_ty = try o.lowerType(struct_ty);
return self.wip.gepStruct(union_llvm_ty, struct_ptr, payload_index, "");
@@ -10801,12 +10801,12 @@ pub const FuncGen = struct {
fn toLlvmAtomicOrdering(atomic_order: std.builtin.AtomicOrder) Builder.AtomicOrdering {
return switch (atomic_order) {
- .Unordered => .unordered,
- .Monotonic => .monotonic,
- .Acquire => .acquire,
- .Release => .release,
- .AcqRel => .acq_rel,
- .SeqCst => .seq_cst,
+ .unordered => .unordered,
+ .monotonic => .monotonic,
+ .acquire => .acquire,
+ .release => .release,
+ .acq_rel => .acq_rel,
+ .seq_cst => .seq_cst,
};
}
@@ -11572,7 +11572,7 @@ fn isByRef(ty: Type, mod: *Module) bool {
};
// Packed structs are represented to LLVM as integers.
- if (struct_type.layout == .Packed) return false;
+ if (struct_type.layout == .@"packed") return false;
const field_types = struct_type.field_types.get(ip);
var it = struct_type.iterateRuntimeOrder(ip);
@@ -11586,7 +11586,7 @@ fn isByRef(ty: Type, mod: *Module) bool {
return false;
},
.Union => switch (ty.containerLayout(mod)) {
- .Packed => return false,
+ .@"packed" => return false,
else => return ty.hasRuntimeBits(mod),
},
.ErrorUnion => {
@@ -11624,8 +11624,8 @@ fn isScalar(mod: *Module, ty: Type) bool {
.Vector,
=> true,
- .Struct => ty.containerLayout(mod) == .Packed,
- .Union => ty.containerLayout(mod) == .Packed,
+ .Struct => ty.containerLayout(mod) == .@"packed",
+ .Union => ty.containerLayout(mod) == .@"packed",
else => false,
};
}
diff --git a/src/codegen/llvm/Builder.zig b/src/codegen/llvm/Builder.zig
index 859d02ce2e..c885261a24 100644
--- a/src/codegen/llvm/Builder.zig
+++ b/src/codegen/llvm/Builder.zig
@@ -8398,7 +8398,7 @@ pub const Metadata = enum(u32) {
fmt_str = fmt_str ++ ")\n";
var fmt_args: @Type(.{ .Struct = .{
- .layout = .Auto,
+ .layout = .auto,
.fields = &fields,
.decls = &.{},
.is_tuple = false,
diff --git a/src/codegen/llvm/bitcode_writer.zig b/src/codegen/llvm/bitcode_writer.zig
index 414cdea682..0b821a32e7 100644
--- a/src/codegen/llvm/bitcode_writer.zig
+++ b/src/codegen/llvm/bitcode_writer.zig
@@ -415,8 +415,8 @@ fn BufType(comptime T: type, comptime min_len: usize) type {
.Enum => |info| info.tag_type,
.Bool => u1,
.Struct => |info| switch (info.layout) {
- .Auto, .Extern => @compileError("Unsupported type: " ++ @typeName(T)),
- .Packed => std.meta.Int(.unsigned, @bitSizeOf(T)),
+ .auto, .@"extern" => @compileError("Unsupported type: " ++ @typeName(T)),
+ .@"packed" => std.meta.Int(.unsigned, @bitSizeOf(T)),
},
else => @compileError("Unsupported type: " ++ @typeName(T)),
})));
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index e95ffee5c1..0b6951ab4f 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -979,7 +979,7 @@ const DeclGen = struct {
},
.struct_type => {
const struct_type = mod.typeToStruct(ty).?;
- if (struct_type.layout == .Packed) {
+ if (struct_type.layout == .@"packed") {
return self.todo("packed struct constants", .{});
}
@@ -1275,7 +1275,7 @@ const DeclGen = struct {
const ip = &mod.intern_pool;
const union_obj = mod.typeToUnion(ty).?;
- if (union_obj.getLayout(ip) == .Packed) {
+ if (union_obj.getLayout(ip) == .@"packed") {
return self.todo("packed union types", .{});
}
@@ -1532,7 +1532,7 @@ const DeclGen = struct {
else => unreachable,
};
- if (struct_type.layout == .Packed) {
+ if (struct_type.layout == .@"packed") {
return try self.resolveType(Type.fromInterned(struct_type.backingIntType(ip).*), .direct);
}
@@ -3904,7 +3904,7 @@ const DeclGen = struct {
const union_ty = mod.typeToUnion(ty).?;
const tag_ty = Type.fromInterned(union_ty.enum_tag_ty);
- if (union_ty.getLayout(ip) == .Packed) {
+ if (union_ty.getLayout(ip) == .@"packed") {
unreachable; // TODO
}
@@ -3984,11 +3984,11 @@ const DeclGen = struct {
switch (object_ty.zigTypeTag(mod)) {
.Struct => switch (object_ty.containerLayout(mod)) {
- .Packed => unreachable, // TODO
+ .@"packed" => unreachable, // TODO
else => return try self.extractField(field_ty, object_id, field_index),
},
.Union => switch (object_ty.containerLayout(mod)) {
- .Packed => unreachable, // TODO
+ .@"packed" => unreachable, // TODO
else => {
// Store, ptr-elem-ptr, pointer-cast, load
const layout = self.unionLayout(object_ty);
@@ -4058,13 +4058,13 @@ const DeclGen = struct {
const object_ty = object_ptr_ty.childType(mod);
switch (object_ty.zigTypeTag(mod)) {
.Struct => switch (object_ty.containerLayout(mod)) {
- .Packed => unreachable, // TODO
+ .@"packed" => unreachable, // TODO
else => {
return try self.accessChain(result_ty_ref, object_ptr, &.{field_index});
},
},
.Union => switch (object_ty.containerLayout(mod)) {
- .Packed => unreachable, // TODO
+ .@"packed" => unreachable, // TODO
else => {
const layout = self.unionLayout(object_ty);
if (!layout.has_payload) {
diff --git a/src/codegen/spirv/Section.zig b/src/codegen/spirv/Section.zig
index 2ce11111a7..002dad2510 100644
--- a/src/codegen/spirv/Section.zig
+++ b/src/codegen/spirv/Section.zig
@@ -154,7 +154,7 @@ pub fn writeOperand(section: *Section, comptime Operand: type, operand: Operand)
}
},
.Struct => |info| {
- if (info.layout == .Packed) {
+ if (info.layout == .@"packed") {
section.writeWord(@as(Word, @bitCast(operand)));
} else {
section.writeExtendedMask(Operand, operand);
@@ -288,7 +288,7 @@ fn operandSize(comptime Operand: type, operand: Operand) usize {
}
break :blk total;
},
- .Struct => |info| if (info.layout == .Packed) 1 else extendedMaskSize(Operand, operand),
+ .Struct => |info| if (info.layout == .@"packed") 1 else extendedMaskSize(Operand, operand),
.Union => extendedUnionSize(Operand, operand),
else => unreachable,
},