std.builtin: rename Type.UnionField and Type.StructField's field_type to type

This commit is contained in:
r00ster91
2022-12-13 22:30:06 +01:00
parent 7350ea3e2d
commit aac2d6b56f
60 changed files with 177 additions and 178 deletions

View File

@@ -15767,7 +15767,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
union_field_fields.* = .{
// name: []const u8,
name_val,
// field_type: type,
// type: type,
try Value.Tag.ty.create(fields_anon_decl.arena(), field.ty),
// alignment: comptime_int,
try Value.Tag.int_u64.create(fields_anon_decl.arena(), alignment),
@@ -15880,7 +15880,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
struct_field_fields.* = .{
// name: []const u8,
name_val,
// field_type: type,
// type: type,
try Value.Tag.ty.create(fields_anon_decl.arena(), field_ty),
// default_value: ?*const anyopaque,
try default_val_ptr.copy(fields_anon_decl.arena()),
@@ -15925,7 +15925,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
struct_field_fields.* = .{
// name: []const u8,
name_val,
// field_type: type,
// type: type,
try Value.Tag.ty.create(fields_anon_decl.arena(), field.ty),
// default_value: ?*const anyopaque,
try default_val_ptr.copy(fields_anon_decl.arena()),
@@ -18574,8 +18574,8 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
// TODO use reflection instead of magic numbers here
// name: []const u8
const name_val = field_struct_val[0];
// field_type: type,
const field_type_val = field_struct_val[1];
// type: type,
const type_val = field_struct_val[1];
// alignment: comptime_int,
const alignment_val = field_struct_val[2];
@@ -18609,7 +18609,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
}
var buffer: Value.ToTypeBuffer = undefined;
const field_ty = try field_type_val.toType(&buffer).copy(new_decl_arena_allocator);
const field_ty = try type_val.toType(&buffer).copy(new_decl_arena_allocator);
gop.value_ptr.* = .{
.ty = field_ty,
.abi_align = @intCast(u32, (try alignment_val.getUnsignedIntAdvanced(target, sema)).?),
@@ -18828,9 +18828,9 @@ fn reifyStruct(
// TODO use reflection instead of magic numbers here
// name: []const u8
const name_val = field_struct_val[0];
// field_type: type,
const field_type_val = field_struct_val[1];
//default_value: ?*const anyopaque,
// type: type,
const type_val = field_struct_val[1];
// default_value: ?*const anyopaque,
const default_value_val = field_struct_val[2];
// is_comptime: bool,
const is_comptime_val = field_struct_val[3];
@@ -18893,7 +18893,7 @@ fn reifyStruct(
}
var buffer: Value.ToTypeBuffer = undefined;
const field_ty = try field_type_val.toType(&buffer).copy(new_decl_arena_allocator);
const field_ty = try type_val.toType(&buffer).copy(new_decl_arena_allocator);
gop.value_ptr.* = .{
.ty = field_ty,
.abi_align = abi_align,
@@ -31439,7 +31439,7 @@ pub fn addExtraAssumeCapacity(sema: *Sema, extra: anytype) u32 {
const fields = std.meta.fields(@TypeOf(extra));
const result = @intCast(u32, sema.air_extra.items.len);
inline for (fields) |field| {
sema.air_extra.appendAssumeCapacity(switch (field.field_type) {
sema.air_extra.appendAssumeCapacity(switch (field.type) {
u32 => @field(extra, field.name),
Air.Inst.Ref => @enumToInt(@field(extra, field.name)),
i32 => @bitCast(u32, @field(extra, field.name)),