std: update std.builtin.Type fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
This commit is contained in:
@@ -2216,7 +2216,7 @@ pub const ElfModule = struct {
|
||||
}
|
||||
|
||||
var section_index: ?usize = null;
|
||||
inline for (@typeInfo(Dwarf.Section.Id).Enum.fields, 0..) |sect, i| {
|
||||
inline for (@typeInfo(Dwarf.Section.Id).@"enum".fields, 0..) |sect, i| {
|
||||
if (mem.eql(u8, "." ++ sect.name, name)) section_index = i;
|
||||
}
|
||||
if (section_index == null) continue;
|
||||
|
||||
@@ -164,7 +164,7 @@ pub fn StackMachine(comptime options: Options) type {
|
||||
}
|
||||
|
||||
fn generic(value: anytype) Operand {
|
||||
const int_info = @typeInfo(@TypeOf(value)).Int;
|
||||
const int_info = @typeInfo(@TypeOf(value)).int;
|
||||
if (@sizeOf(@TypeOf(value)) > options.addr_size) {
|
||||
return .{ .generic = switch (int_info.signedness) {
|
||||
.signed => @bitCast(@as(addr_type_signed, @truncate(value))),
|
||||
@@ -843,7 +843,7 @@ pub fn Builder(comptime options: Options) type {
|
||||
}
|
||||
|
||||
pub fn writeConst(writer: anytype, comptime T: type, value: T) !void {
|
||||
if (@typeInfo(T) != .Int) @compileError("Constants must be integers");
|
||||
if (@typeInfo(T) != .int) @compileError("Constants must be integers");
|
||||
|
||||
switch (T) {
|
||||
u8, i8, u16, i16, u32, i32, u64, i64 => {
|
||||
@@ -861,7 +861,7 @@ pub fn Builder(comptime options: Options) type {
|
||||
|
||||
try writer.writeInt(T, value, options.endian);
|
||||
},
|
||||
else => switch (@typeInfo(T).Int.signedness) {
|
||||
else => switch (@typeInfo(T).int.signedness) {
|
||||
.unsigned => {
|
||||
try writer.writeByte(OP.constu);
|
||||
try leb.writeUleb128(writer, value);
|
||||
|
||||
@@ -32,7 +32,7 @@ pub fn readByteSigned(fbr: *FixedBufferReader) Error!i8 {
|
||||
}
|
||||
|
||||
pub fn readInt(fbr: *FixedBufferReader, comptime T: type) Error!T {
|
||||
const size = @divExact(@typeInfo(T).Int.bits, 8);
|
||||
const size = @divExact(@typeInfo(T).int.bits, 8);
|
||||
if (fbr.buf.len - fbr.pos < size) return error.EndOfBuffer;
|
||||
defer fbr.pos += size;
|
||||
return std.mem.readInt(T, fbr.buf[fbr.pos..][0..size], fbr.endian);
|
||||
|
||||
@@ -495,7 +495,7 @@ const MsfStream = struct {
|
||||
blocks: []u32 = undefined,
|
||||
block_size: u32 = undefined,
|
||||
|
||||
pub const Error = @typeInfo(@typeInfo(@TypeOf(read)).Fn.return_type.?).ErrorUnion.error_set;
|
||||
pub const Error = @typeInfo(@typeInfo(@TypeOf(read)).@"fn".return_type.?).error_union.error_set;
|
||||
|
||||
fn init(block_size: u32, file: File, blocks: []u32) MsfStream {
|
||||
const stream = MsfStream{
|
||||
|
||||
@@ -37,7 +37,7 @@ modules: if (native_os == .windows) std.ArrayListUnmanaged(WindowsModule) else v
|
||||
pub const OpenError = error{
|
||||
MissingDebugInfo,
|
||||
UnsupportedOperatingSystem,
|
||||
} || @typeInfo(@typeInfo(@TypeOf(SelfInfo.init)).Fn.return_type.?).ErrorUnion.error_set;
|
||||
} || @typeInfo(@typeInfo(@TypeOf(SelfInfo.init)).@"fn".return_type.?).error_union.error_set;
|
||||
|
||||
pub fn open(allocator: Allocator) OpenError!SelfInfo {
|
||||
nosuspend {
|
||||
@@ -582,7 +582,7 @@ pub const Module = switch (native_os) {
|
||||
if (!std.mem.eql(u8, "__DWARF", sect.segName())) continue;
|
||||
|
||||
var section_index: ?usize = null;
|
||||
inline for (@typeInfo(Dwarf.Section.Id).Enum.fields, 0..) |section, i| {
|
||||
inline for (@typeInfo(Dwarf.Section.Id).@"enum".fields, 0..) |section, i| {
|
||||
if (mem.eql(u8, "__" ++ section.name, sect.sectName())) section_index = i;
|
||||
}
|
||||
if (section_index == null) continue;
|
||||
@@ -981,7 +981,7 @@ fn readCoffDebugInfo(allocator: Allocator, coff_obj: *coff.Coff) !Module {
|
||||
var sections: Dwarf.SectionArray = Dwarf.null_section_array;
|
||||
errdefer for (sections) |section| if (section) |s| if (s.owned) allocator.free(s.data);
|
||||
|
||||
inline for (@typeInfo(Dwarf.Section.Id).Enum.fields, 0..) |section, i| {
|
||||
inline for (@typeInfo(Dwarf.Section.Id).@"enum".fields, 0..) |section, i| {
|
||||
sections[i] = if (coff_obj.getSectionByName("." ++ section.name)) |section_header| blk: {
|
||||
break :blk .{
|
||||
.data = try coff_obj.getSectionDataAlloc(section_header, allocator),
|
||||
@@ -1443,7 +1443,7 @@ pub fn unwindFrameMachO(
|
||||
if (ma.load(usize, new_sp) == null or ma.load(usize, min_reg_addr) == null) return error.InvalidUnwindInfo;
|
||||
|
||||
var reg_addr = fp - @sizeOf(usize);
|
||||
inline for (@typeInfo(@TypeOf(encoding.value.arm64.frame.x_reg_pairs)).Struct.fields, 0..) |field, i| {
|
||||
inline for (@typeInfo(@TypeOf(encoding.value.arm64.frame.x_reg_pairs)).@"struct".fields, 0..) |field, i| {
|
||||
if (@field(encoding.value.arm64.frame.x_reg_pairs, field.name) != 0) {
|
||||
(try regValueNative(context.thread_context, 19 + i, reg_context)).* = @as(*const usize, @ptrFromInt(reg_addr)).*;
|
||||
reg_addr += @sizeOf(usize);
|
||||
@@ -1452,7 +1452,7 @@ pub fn unwindFrameMachO(
|
||||
}
|
||||
}
|
||||
|
||||
inline for (@typeInfo(@TypeOf(encoding.value.arm64.frame.d_reg_pairs)).Struct.fields, 0..) |field, i| {
|
||||
inline for (@typeInfo(@TypeOf(encoding.value.arm64.frame.d_reg_pairs)).@"struct".fields, 0..) |field, i| {
|
||||
if (@field(encoding.value.arm64.frame.d_reg_pairs, field.name) != 0) {
|
||||
// Only the lower half of the 128-bit V registers are restored during unwinding
|
||||
@memcpy(
|
||||
|
||||
Reference in New Issue
Block a user